I'm trying to get better understanding of repository pattern in Domain Driven Design. All examples of repository pattern implementation are dealing with entities only. But what if i need to retrieve only some part of entity? For example, i have Client entity with large amount of properties. Can i define something like this in ClientRepository:
public IEnumerable<string> GetClientsNames() { ... }
of even:
class ClientBaseInfo //includes some subset of properties of Client entity
{
public string Name {get; set;}
public string Surname {get; set;}
public int Age {get; set;}
public string Email {get; set;}
}
....
public IEnumerable<ClientBaseInfo> GetClientsBaseInfo() { ... }
The reason for such implementation is performance. Anyway i consider my code will become polluted with this kind of "partial entities". Is this approach used in some way in real-life projects? Or the only way to avoid loading heavy entities is splitting of table and its corresponding entity or something else?
EDIT: Yes, i'm talking about something like DTO. I doubt if repository is intended to deal with this kind of objects, or it is for business entities only. I can define a lot of different DTOs for specific situations, but can my code become too complicated? I have no answer, because i don't have enought experience. I would like to know opinion of somebody experienced.