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