Example #1
0
 public UnitOfWork(ApplicationDbContext db)
 {
     _db             = db;
     Category        = new CategoryRepository(_db);
     FoodType        = new FoodTypeRepository(_db);
     MenuItem        = new MenuItemRepository(_db);
     ApplicationUser = new ApplicationUserRepository(_db);
     ShoppingCart    = new ShoppingCartRepository(_db);
     OrderHeader     = new OrderHeaderRepository(_db);
     OrderDetails    = new OrderDetailsRepository(_db);
 }
Example #2
0
 public UnitOfWork(ApplicationDbContext dbContext)
 {
     this.dbContext  = dbContext;
     Category        = new CategoryRepository(dbContext);
     FoodType        = new FoodTypeRepository(dbContext);
     MenuItem        = new MenuItemRepository(dbContext);
     ApplicationUser = new ApplicationUserRepository(dbContext);
     ShoppingCart    = new ShoppingCartRepository(dbContext);
     OrderHeader     = new OrderHeaderRepository(dbContext);
     OrderDetail     = new OrderDetailRepository(dbContext);
 }