Exemplo n.º 1
0
        public IActionResult Create(PlanningCreateViewModel vmModel)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    vmModel.UserId = User.FindFirstValue(ClaimTypes.NameIdentifier);
                    vmModel.CreateMeal();
                    return(RedirectToAction("Index", "Planning"));
                }
                catch
                {
                    throw;
                }
            }

            return(View(vmModel));
        }
Exemplo n.º 2
0
        public IActionResult Create()
        {
            var model = new PlanningCreateViewModel();

            return(View(model));
        }