Esempio n. 1
0
 public ProductRepository(WebDbContexts db)
 {
     this.db = db;
     foreach (Product product in db.Product)
     {
         product.Brand = db.Brands.Find(product.BrandId);
     }
 }
Esempio n. 2
0
 public OrderRepository(WebDbContexts db)
 {
     foreach (Order order in db.Order)
     {
         order.OrderedProducts = db.OrderedProduct.Where(p => p.OrderId == order.Id).ToList();
     }
     this.db = db;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 public CityRepository(WebDbContexts db)
 {
     this.db = db;
 }
Esempio n. 5
0
 public BrandRepository(WebDbContexts db)
 {
     this.db = db;
 }
 public OrderedProductRepository(WebDbContexts db)
 {
     this.db = db;
 }