public void DeleteCupcake(int id) { var cupcake = _context.Cupcakes.First(c => c.CupcakeId == id); _context.Remove(cupcake); _context.SaveChanges(); }
public void DeleteCupcake(int id) { _ = _context.Remove(_context.Cupcakes.SingleOrDefault(c => c.CupcakeID == id)); _ = _context.SaveChanges(); }