public RecipeDishIngr EditRecipeDishIngr(int id, double volume, string description) { RecipeDishIngr p = cont.RecipeDishIngr.SingleOrDefault(c => c.Id == id); p.Volume = volume; p.Description = description; cont.RecipeDishIngr.Add(p); cont.SaveChanges(); return(p); }
public RecipeDishIngr AddRecipeDishIngr(double volume, string description, Product ingredient, Dish dish) { RecipeDishIngr p = new RecipeDishIngr { Volume = volume, Description = description, Ingredient = ingredient, Dish = dish, }; cont.RecipeDishIngr.Add(p); cont.SaveChanges(); return(p); }