Exemplo n.º 1
0
        public void DeleteOrder(Order order)
        {
            using var context = new project0Context(_contextOptions);
            var dbOrder = context.Orders
                          .Where(i => i.OrderId == order.OrderId)
                          .FirstOrDefault();

            context.Remove(dbOrder);
            context.SaveChanges();
        }
Exemplo n.º 2
0
        public void DeleteCustomer(Customer customer)
        {
            using var context = new project0Context(_context);
            var dbCustomer = context.Customers
                             .Where(i => i.CustomerId == customer.CustomerId)
                             .FirstOrDefault();

            context.Remove(dbCustomer);
            context.SaveChanges();
        }
Exemplo n.º 3
0
        public void DeleteStore(Store store)
        {
            using var context = new project0Context(_context);
            var dbLocation = context.Stores
                             .Where(i => i.StoreId == store.StoreId)
                             .FirstOrDefault();

            context.Remove(dbLocation);
            context.SaveChanges();
        }