示例#1
0
 public UnitOfWork(EquipmentStoreContext context)
 {
     _context                      = context;
     _productRepository            = new Lazy <IExtendingRepository <Product> >(() => new ProductRepository(_context));
     _pumpRepository               = new Lazy <IExtendingRepository <Pump> >(() => new PumpRepository(_context));
     _outputRepository             = new Lazy <IRepository <Output> >(() => new Repository <Output>(_context));
     _productImageRepository       = new Lazy <IImageRepository <ProductImage> >(() => new ProductImageRepository(_context));
     _pumpImageRepository          = new Lazy <IImageRepository <PumpImage> >(() => new PumpImageRepository(_context));
     _outputImageRepository        = new Lazy <IImageRepository <OutputImage> >(() => new OutputImageRepository(_context));
     _productCategoryRepository    = new Lazy <IRepository <ProductCategory> >(() => new Repository <ProductCategory>(_context));
     _pumpCategoryRepository       = new Lazy <IRepository <PumpCategory> >(() => new Repository <PumpCategory>(_context));
     _productSubCategoryRepository = new Lazy <IExtendingRepository <ProductSubCategory> >(() => new ProductSubCategoryRepository(_context));
 }
示例#2
0
 public PumpRepository(EquipmentStoreContext context) : base(context)
 {
     _context = context;
 }
 public PumpImageRepository(EquipmentStoreContext context)
 {
     _context = context;
 }
 public ProductSubCategoryRepository(EquipmentStoreContext context) : base(context)
 {
     _context = context;
 }
 public OutputImageRepository(EquipmentStoreContext context)
 {
     _context = context;
 }
示例#6
0
 public Repository(EquipmentStoreContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }