public UnitofWork(PizzaBoxContext context) { _context = context; Customer = new CustomerRepository(_context); Employee = new EmployeeRepository(_context); Pizza = new PizzaRepository(_context); Order = new OrderRepository(_context); Address = new AddressRepository(_context); Store = new StoreRepository(_context); Ingrediants = new IngredientsRepository(_context); }
public UnitOfWork(PizzaBoxContext context) { _context = context; Stores = new StoreRepository(context); Customers = new CustomerRepository(context); Crusts = new CrustRepository(context); Sizes = new SizeRepository(context); Toppings = new ToppingRepository(context); Pizzas = new PizzaRepository(context); Orders = new OrderRepository(context); }
public static List <Order> StoreHistory(PizzaBoxContext context, int StoreID) { return(context.Orders .Where(a => a.Store.EntityID == StoreID) .Include(b => b.Customer) .Include(b => b.Items) .ThenInclude(b => b.Crust) .Include(b => b.Items) .ThenInclude(b => b.Size) .Include(b => b.Items) .ThenInclude(b => b.Toppings) .ToList()); }
public PizzaBoxRepository(PizzaBoxContext context) { _ctx = context; }
public static void Save <T>(PizzaBoxContext context, T ThingToSave) where T : class { context.Add(ThingToSave); context.SaveChanges(); }