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);
 }
Exemple #2
0
 public T Update(T entity)
 {
     _ProyectoDbContext.Entry(entity).State = EntityState.Modified;
     _ProyectoDbContext.SaveChanges();
     return(entity);
 }