public Data.Occupancy UpdateOccupancy(Data.Occupancy occupancy) { if (!_context.Users.Local.Any(a => a.ID == occupancy.ID)) { _context.Occupancies.Attach(occupancy); } _context.Entry(occupancy).State = EntityState.Modified; _context.SaveChanges(); return(occupancy); }
public Data.Ingredient UpdateIngredient(Data.Ingredient ingredient) { if (!_context.Ingredients.Local.Any(i => i.Id == ingredient.Id)) { _context.Ingredients.Attach(ingredient); } _context.Entry(ingredient).State = EntityState.Modified; _context.SaveChanges(); return(ingredient); }
public Data.Product UpdateProduct(Data.Product product) { if (!_context.Products.Local.Any(sal => sal.ID == product.ID)) { _context.Products.Attach(product); } _context.Entry(product).State = EntityState.Modified; _context.SaveChanges(); return(product); }
public Data.Log UpdateLog(Data.Log log) { if (!_context.Logs.Local.Any(rec => rec.ID == log.ID)) { _context.Logs.Attach(log); } _context.Entry(log).State = EntityState.Modified; _context.SaveChanges(); return(log); }
public Data.Sale UpdateSale(Data.Sale sale) { if (!_context.Sales.Local.Any(sal => sal.ID == sale.ID)) { _context.Sales.Attach(sale); } _context.Entry(sale).State = EntityState.Modified; _context.SaveChanges(); return(sale); }
public Data.Category UpdateCategory(Data.Category category) { if (!_context.Categories.Local.Any(c => c.ID == category.ID)) { _context.Categories.Attach(category); } _context.Entry(category).State = EntityState.Modified; _context.SaveChanges(); return(category); }
public Data.Product UpdateProduct(Data.Product agenda) { if (!_context.Products.Local.Any(a => a.Id == agenda.Id)) { _context.Products.Attach(agenda); } _context.Entry(agenda).State = EntityState.Modified; _context.SaveChanges(); return(agenda); }
public Data.Table UpdateTable(Data.Table table) { if (!_context.Tables.Local.Any(i => i.Id == table.Id)) { _context.Tables.Attach(table); } _context.Entry(table).State = EntityState.Modified; _context.SaveChanges(); return(table); }
public Data.Reservation UpdateReservation(Data.Reservation reservation) { if (!_context.Reservations.Local.Any(res => res.ID == reservation.ID)) { _context.Reservations.Attach(reservation); } _context.Entry(reservation).State = EntityState.Modified; _context.SaveChanges(); return(reservation); }
public Data.RecipeItem UpdateRecipe(Data.RecipeItem recipe) { if (!_context.RecipeItems.Local.Any(rec => rec.ID == recipe.ID)) { _context.RecipeItems.Attach(recipe); } _context.Entry(recipe).State = EntityState.Modified; _context.SaveChanges(); return(recipe); }
public Data.Supplier UpdateSupplier(Data.Supplier supplier) { if (!_context.Suppliers.Local.Any(i => i.ID == supplier.ID)) { _context.Suppliers.Attach(supplier); } _context.Entry(supplier).State = EntityState.Modified; _context.SaveChanges(); return(supplier); }
public Data.User UpdateUser(Data.User user) { if (!_context.Users.Local.Any(a => a.ID == user.ID)) { _context.Users.Attach(user); } _context.Entry(user).State = EntityState.Modified; _context.SaveChanges(); return(user); }