I don’t know that what I would like to do is simply impossible: or I don’t think about it in the right way.
I am trying to build a repository interface class that takes a generic type and uses it as a basis for returning with most of its methods, i.e.:
public interface IRepository<T> { void Add(T source); T Find(int id); }
This will then be inherited by the actual repository class, for example:
public class TestClientRepository : IRepository<ClientEmailAddress>, IRepository<ClientAccount> { }
The idea is that in ClientRepository, for example, I want to perform operations with several different types of objects (ClientAccount, ClientEmailAddress, etc.); but basically all types of operations are needed.
When I try to use TestClientRepository (after an explicit implementation of the interface), I do not see several search and add methods.
Can anyone help? Thanks.
source share