public void ClearList(int listId)
        {
            var ingredients = _context.Ingredient.Where(i => i.ListId == listId);

            ingredients.ToList().ForEach(i => {
                i.IsDeleted = true;
            });
            _context.SaveChanges();
        }
Example #2
0
 public T Add(T entity)
 {
     _ProyectoDbContext.Add(entity);
     _ProyectoDbContext.SaveChanges();
     return(entity);
 }