У меня есть классы и реализация интерфейса ниже
public interface IPageRepository<T> : IRepository
{
IList<T> GetPage(Criteria criteria, out int totalRows);
}
public interface ICategoryRepository : IPageRepository<Category>
{
// rest of the methods
}
public class CategoryRepository : BaseDap, ICategoryRepository
{
// method implementations
}
public class RepositoryFactory
{
private static readonly Dictionary<Type, Type> container = new Dictionary<Type, Type>();
static RepositoryFactory()
{
container.Add<ICategoryRepository, CategoryRepository>();
//Getting error here:
//The non-generic method 'Dictionary<Type, Type>.Add(Type, Type)' cannot be used with type arguments
}
}
Я следовал аналогичному шаблону в другом проекте, и он работает там.Что мне здесь не хватает?