public RecipePrepIngr EditRecipePrepIngr(int id, double volume, string description) { RecipePrepIngr p = cont.RecipePrepIngr.SingleOrDefault(c => c.Id == id); p.Volume = volume; p.Description = description; cont.RecipePrepIngr.Add(p); cont.SaveChanges(); return(p); }
public RecipePrepIngr AddRecipePrepIngr(double volume, string description, Product ingredient, Prepack prepack) { RecipePrepIngr p = new RecipePrepIngr { Volume = volume, Description = description, Ingredient = ingredient, Prepack = prepack, }; cont.RecipePrepIngr.Add(p); cont.SaveChanges(); return(p); }