public async Task <IActionResult> Update(string id, RecipeMenu updatedDietType)
        {
            var queriedRecipeMenu = await _recipeMenuService.GetByIdAsync(id);

            if (queriedRecipeMenu == null)
            {
                return(NotFound());
            }
            await _recipeMenuService.UpdateAsync(id, updatedDietType);

            return(NoContent());
        }
Esempio n. 2
0
        public void GetMenuRecipe(RecipeMenu menu)
        {
            string name = menu.Title;

            Menu = menu;
            if (name == "Non-Vegetarian")
            {
                name = "Nonveg";
            }
            var en = (EasyRecipes.ServiceBase.ServiceRequest)Enum.Parse(typeof(EasyRecipes.ServiceBase.ServiceRequest), name.ToUpper());

            EasyRecipes.ReciepeAPI.Instance.GetReciepes((x) =>
            {
                RunSafeDispatcherThread(() =>
                {
                    Recipes = x;
                    IsBusy  = false;
                });
            }, en);
        }
        public async Task <IActionResult> Create(RecipeMenu recipeMenu)
        {
            await _recipeMenuService.CreateAsync(recipeMenu);

            return(Ok(recipeMenu));
        }
Esempio n. 4
0
 // This Method will use a jump tree allows the user to select from optioned provided in the text file.
 private void jumpTree(int userChoice)
 {
     RecipeMenu Recipe = new RecipeMenu();                                 // Allows us to move to the RecipeMenu class
     AlgorithmMenu Algorithm = new AlgorithmMenu();                        // Allows us to move to the AlgorithmMenu class
     ExitScreen Exit = new ExitScreen();                                   // Allows us to move to the Exit class
     switch (userChoice)
     {
         case 1:
             Recipe.displayScreen();
             break;
         case 2:
             Algorithm.displayScreen();
             break;
         case 3:
             Exit.exitScreen();
             break;
         default:
             Console.WriteLine("Something went wrong in the jumpTree");
             break;
     }
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            RecipeMenu menu = new RecipeMenu();

            menu.Start();
        }
Esempio n. 6
0
 public async Task UpdateAsync(string id, RecipeMenu RecipeMenu)
 {
     await _menu.ReplaceOneAsync(s => s.Id == id, RecipeMenu);
 }
Esempio n. 7
0
        public async Task <RecipeMenu> CreateAsync(RecipeMenu RecipeMenu)
        {
            await _menu.InsertOneAsync(RecipeMenu);

            return(RecipeMenu);
        }