Esempio n. 1
0
        public async Task <IActionResult> Create(TodoAppViewModel todoAppViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(todoAppViewModel));
            }

            if (ResponseHasErrors(await _todoAppService.Register(todoAppViewModel)))
            {
                return(View(todoAppViewModel));
            }

            ViewBag.Sucess = "Task Registered!";

            return(View(todoAppViewModel));
        }
Esempio n. 2
0
 public async Task <IActionResult> Post([FromForm] TodoAppViewModel todoAppViewModel)
 {
     return(ModelState.IsValid ? CustomResponse(await _todoAppService.Register(todoAppViewModel))
         : CustomResponse(todoAppViewModel));
 }