예제 #1
0
 public static dynamic GetAllIngredientsById(DishRecipesDBContext db, int id)
 {
     return(db.ingredientsInRecipes
            .Include(i => i.Ingredient)
            .Where(i => i.RecipeID == id)
            .Select(i => new
     {
         i.Ingredient.ID,
         i.Ingredient.Name,
         i.Ingredient.Image,
         i.Ingredient.Calories,
         i.Order
     }));
 }
예제 #2
0
 public static List <Ingredient> GetAllIngredients(DishRecipesDBContext db)
 {
     return(db.Ingredients.ToList());
 }
예제 #3
0
 public static List <recipe> GetAllRecipes(DishRecipesDBContext db)
 {
     return(db.recipes.ToList());
 }