Ejemplo 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));
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> Post([FromForm] TodoAppViewModel todoAppViewModel)
 {
     return(ModelState.IsValid ? CustomResponse(await _todoAppService.Register(todoAppViewModel))
         : CustomResponse(todoAppViewModel));
 }