Here is what I would like to do:
public interface IRepository<TSet<TElement>> where TSet<TElement> : IEnumerable<TElement> { TSet<TEntity> GetSet<TEntity>(); }
Is such a construction possible in .NET?
Change The question was not clear enough. Here is what I want to do, expanded:
public class DbRepository : IRepository<DbSet<TElement>> { DbSet<TEntity> GetSet<TEntity>(); } public class ObjectRepository : IRepository<ObjectSet<TElement>> { ObjectSet<TEntity> GetSet<TEntity>(); }
Value, I want the associated type: - accept one common parameter - implement the given one common parameter interface.
Is it possible? In fact, I will be glad only the first.
public interface IRepository<TGeneric<TElement>> { TGeneric<TArgument> GetThing<TArgument>(); }
Jean hominal
source share