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 } }
container.Add(typeof(ICategoryRepository), typeof(CategoryRepository));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)