コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }