public ProductRepository(WebDbContexts db) { this.db = db; foreach (Product product in db.Product) { product.Brand = db.Brands.Find(product.BrandId); } }
public OrderRepository(WebDbContexts db) { foreach (Order order in db.Order) { order.OrderedProducts = db.OrderedProduct.Where(p => p.OrderId == order.Id).ToList(); } this.db = db; }
public HomeController(WebDbContexts contexts, IHttpContextAccessor httpContextAccessor) { allProducts = new ProductRepository(contexts); allBrands = new BrandRepository(contexts); allCities = new CityRepository(contexts); allOrderedProduct = new OrderedProductRepository(contexts); allOrders = new OrderRepository(contexts); _httpContextAccessor = httpContextAccessor; }
public CityRepository(WebDbContexts db) { this.db = db; }
public BrandRepository(WebDbContexts db) { this.db = db; }
public OrderedProductRepository(WebDbContexts db) { this.db = db; }