예제 #1
0
        public Recipe InsertRecipe(Recipe r)
        {
            db.Recipes.Add(r);
            db.SaveChanges();
            DetatchData(r);

            var newR = db.Recipes.Where(s => s.RecipeID == r.RecipeID).FirstOrDefault();

            return(newR);
        }
예제 #2
0
 public Ingredient InsertIngredient(Ingredient i)
 {
     db.Ingredients.Add(i);
     db.SaveChanges();
     return(i);
 }