Trying to understand if I can extend a Generic Repository Interface or not.
Sorry, I'm new to this and have google search this and can't find any such implementation which leads me to think I'm trying to defy the generic repository logic.
I'm using EF Core ORM.
IEnumerable<T> GetAll(); T Get(long id); void Insert(T entity); void Update(T entity); void Delete(T entity);
I then implement a Generic Repository:
public class Repository<T> : IRepository<T> where T : class
However I need to implement a special method for ONLY one entity name
Conference such as:
IList<T> GetIncludedItems(Expression<Func<T, bool>> predicate, params string navigationProperties);
How can I extend my Generic Repository to handle that one exception method without having the other entities implementing it. In addition, my
service class will be implementing these
Repositories via constructor injection.
public ConferenceService(IRepository<Conference> _conferenceRepository )
I also need to maintain Dependency binding via my
Any suggestion where I'm going wrong or how I can accomplish this?
Here is the solution to my problem, I need to inherit the base repository if I want to add a custom method for a specific entity. click here to see how to solve the above problem