Ejemplo n.º 1
0
        public void CancelOrder(int userId)
        {
            Incomplete incomplete = context.Incomplete
                                    .Include(o => o.IncompletePizza)
                                    .ThenInclude(o => o.IncompleteToppings)
                                    .Where(o => o.Userid == userId).FirstOrDefault();

            if (incomplete != null)
            {
                context.Remove(incomplete);
                context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public void Remove(int id)
        {
            DBStore existingStore = context.DBStores.FirstOrDefault(store => store.ID == id);

            if (existingStore is not null)
            {
                context.Remove(existingStore);
                context.SaveChanges();
            }
        }
Ejemplo n.º 3
0
        public void Remove(AStore genericType)
        {
            DBStore existingStore = context.DBStores.ToList().Find(store => store.Name.Equals(genericType.Name));

            if (existingStore is not null)
            {
                context.Remove(existingStore);
                context.SaveChanges();
            }
        }
        /// <summary>
        /// Creates two
        /// </summary>
        /// <param name="genericType"></param>
        public void Remove(int id)
        {
            DBOrder order = context.DBOrders.FirstOrDefault(order => order.ID == id);

            if (order is not null)
            {
                context.Remove(order);
                context.SaveChanges();
            }
        }
        public void Remove(int id)
        {
            DBCrust crust = context.DBCrusts.FirstOrDefault(crust => crust.ID == id);

            if (crust is not null)
            {
                context.Remove(crust);
                context.SaveChanges();
            }
        }
Ejemplo n.º 6
0
        public void Remove(int id)
        {
            DBPizza pizza = context.DBPizzas.FirstOrDefault(pizza => pizza.ID == id);

            if (pizza is not null)
            {
                context.Remove(pizza);
                context.SaveChanges();
            }
        }
        public void Remove(int id)
        {
            DBSize size = context.DBSizes.FirstOrDefault(size => size.ID == id);

            if (size is not null)
            {
                context.Remove(size);
                context.SaveChanges();
            }
        }
Ejemplo n.º 8
0
        public void Remove(int id)
        {
            DBTopping topping = context.DBToppings.FirstOrDefault(topping => topping.ID == id);

            if (topping is not null)
            {
                context.Remove(topping);
                context.SaveChanges();
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Creates two
        /// </summary>
        /// <param name="genericType"></param>
        public void Remove(Order genericType)
        {
            DBOrder dbOrder = mapperOrder.Map(genericType);
            DBOrder order   = context.DBOrders.ToList().Find(order => order.GetHashCode() == dbOrder.GetHashCode());

            if (order is not null)
            {
                context.Remove(order);
                context.SaveChanges();
            }
        }
        public void Remove(Topping genericType)
        {
            DBTopping dBTopping = mapperTopping.Map(genericType);
            DBTopping topping   = context.DBToppings.ToList().Find(topping => topping.TOPPING == dBTopping.TOPPING);

            if (topping is not null)
            {
                context.Remove(topping);
                context.SaveChanges();
            }
        }
Ejemplo n.º 11
0
        public void Remove(Crust genericType)
        {
            DBCrust dBCrust = mapperCrust.Map(genericType);
            DBCrust crust   = context.DBCrusts.ToList().Find(crust => crust.CRUST == dBCrust.CRUST);

            if (crust is not null)
            {
                context.Remove(crust);
                context.SaveChanges();
            }
        }
        public void Remove(Size genericType)
        {
            DBSize dBSize = mapperSize.Map(genericType);
            DBSize size   = context.DBSizes.ToList().Find(size => size.SIZE == dBSize.SIZE);

            if (size is not null)
            {
                context.Remove(size);
                context.SaveChanges();
            }
        }
        public void Remove(APizza genericType)
        {
            DBPizza dbPizza = mapperPizza.Map(genericType);
            DBPizza pizza   = context.DBPizzas.ToList().Find(pizza => pizza.GetHashCode() == dbPizza.GetHashCode());

            if (pizza is not null)
            {
                context.Remove(pizza);
                context.SaveChanges();
            }
        }
Ejemplo n.º 14
0
        public void DeleteTopping(int id)
        {
            var topping = db.Toppings.FirstOrDefault(c => c.Id == id);

            if (topping.Id == id)
            {
                db.Remove(topping);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"Topping with this Id {id} does not exist");
                return;
            }
        }
Ejemplo n.º 15
0
        public void DeleteOrder(int id)
        {
            var order = db.Orders.FirstOrDefault(o => o.Id == id);

            if (order.Id == id)
            {
                db.Remove(order);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"Order with this Id {id} does not exist");
                return;
            }
        }
        public void DeletePanSize(int id)
        {
            var size = db.CrustTypes.FirstOrDefault(s => s.Id == id);

            if (size.Id == id)
            {
                db.Remove(size);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"Pan size with this Id {id} does not exist");
                return;
            }
        }
Ejemplo n.º 17
0
        public void DeleteCrustType(int id)
        {
            var crust = db.CrustTypes.FirstOrDefault(c => c.Id == id);

            if (crust.Id == id)
            {
                db.Remove(crust);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"Crust with this Id {id} does not exist");
                return;
            }
        }
        public void DeleteStores(int id)
        {
            var store = db.Stores.FirstOrDefault(c => c.Id == id);

            if (store.Id == id)
            {
                db.Remove(store);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"Store with this Id {id} does not exist");
                return;
            }
        }
        public void DeleteFromOurPizzas(int id)
        {
            var ourPizza = db.OurPizzas.FirstOrDefault(p => p.Id == id);

            if (ourPizza.Id == id)
            {
                db.Remove(ourPizza);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"Pizza with this Id {id} does not exist");
                return;
            }
        }
Ejemplo n.º 20
0
        public void DeleteUser(int id)
        {
            var user = db.Users.FirstOrDefault(u => u.Id == id);

            if (user.Id == id)
            {
                db.Remove(user);
                db.SaveChanges();
            }
            else
            {
                Console.WriteLine($"User with this Id {id} does not exist");
                return;
            }
        }