Example #1
0
 public void Update(Manufacturer manufacturer)
 {
     using (var dbContext = new SportStoreDbContext())
     {
         var manufacturerInRepository = dbContext.ManufacturerDbSet.Find(manufacturer.Id);
         dbContext.Entry(manufacturerInRepository).CurrentValues.SetValues(manufacturer);
         dbContext.SaveChanges();
     }
 }
Example #2
0
 public void Update(PaymentMethod payment)
 {
     using (var dbContext = new SportStoreDbContext())
     {
         var paymentMethodInRepository = dbContext.PaymentMethodDbSet.Find(payment.Id);
         dbContext.Entry(paymentMethodInRepository).CurrentValues.SetValues(payment);
         dbContext.SaveChanges();
     }
 }
Example #3
0
 public void Update(ShippingAddress shippingAddress)
 {
     using (var dbContext = new SportStoreDbContext())
     {
         var shippingAddressInRepository = dbContext.ShippingAddressDbSet.Find(shippingAddress.Id);
         dbContext.Entry(shippingAddressInRepository).CurrentValues.SetValues(shippingAddress);
         dbContext.SaveChanges();
     }
 }
Example #4
0
 public void Update(PurchasedProduct purchasedProduct)
 {
     using (var dbContext = new SportStoreDbContext())
     {
         var purchasedProductInRepository = GetById(purchasedProduct.Id);
         dbContext.Entry(purchasedProductInRepository).CurrentValues.SetValues(purchasedProduct);
         dbContext.SaveChanges();
     }
 }