Пример #1
0
        public BaseRepository(ICatalogContext catalogContext)
        {
            if (catalogContext == null)
            {
                throw new ArgumentNullException(nameof(catalogContext));
            }

            this.collection = catalogContext.GetCollection <T>(typeof(T).Name);
        }
Пример #2
0
 public CategoryProductRepository(ICatalogContext context)
 {
     Context = context;
     DbSet   = Context.GetCollection <Models.CategoryProduct>(typeof(Models.CategoryProduct).Name);
 }
Пример #3
0
 private void ConfigDbSet()
 {
     DbSet = Context.GetCollection <Models.Product>(typeof(Models.Product).Name);
 }