public Ingredient RemoveIngredientFromList(Ingredient ingredient) { _context.Ingredient.Attach(ingredient); ingredient.IsDeleted = true; _context.Entry(ingredient).Property(i => i.IsDeleted).IsModified = true; _context.Entry(ingredient).State = EntityState.Modified; _context.SaveChanges(); return(ingredient); }
public T Update(T entity) { _ProyectoDbContext.Entry(entity).State = EntityState.Modified; _ProyectoDbContext.SaveChanges(); return(entity); }