示例#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);
 }