class A
{
public int id {get; set;}
}
class B : A
{
}
class C : A
{
}
Now does it make sense to have a separate repository for B and C or should I pass in the type information to a method in the Repository for A and return stuff from there.
class ARepository : RepositoryBase<Context>,IARepository
{
A GetById (int id )
{
//some linq query here
}
//should this be here or in a separate repository
A GetBByID (int id)
{
}
}
The reason I would go for another Repository would be If I wanted
class D : A
or Class E : C
this could start to get messy and tricky .
So what is the best way of going about this ?
I prefer having one large repository per EntityFramework Context, it simplifies maintenance.