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 })); }
public static List <Ingredient> GetAllIngredients(DishRecipesDBContext db) { return(db.Ingredients.ToList()); }
public static List <recipe> GetAllRecipes(DishRecipesDBContext db) { return(db.recipes.ToList()); }