c#Repository pattern: One repository per subclass?
- by Alex
I am wondering if you would create a repository for each subclass of a domain model.
There are two classes for example:
public class Person
{
public virtual String GivenName { set; get; }
public virtual String FamilyName { set; get; }
public virtual String EMailAdress { set; get; }
}
public class Customer : Person
{
public virtual DateTime RegistrationDate { get; set; }
public virtual String Password { get; set; }
}
Would you create both a PersonRepository and a CustomerRepository or just the PersonRepository which would also be able to execute Customer related queries?