public ActionResult Create(FormCollection post) { if (!string.IsNullOrEmpty(post["InputTodoWhat"])) { todoListService.CreateTask(post["InputTodoWhat"] as string); } return(RedirectToAction("List")); }
public ActionResult CreateTask(string taskTodo) { bool result = false; if (!string.IsNullOrEmpty(taskTodo)) { result = todoListService.CreateTask(taskTodo); } return(Content(result.ToString())); }
public IActionResult CreateTask(TaskDto requestModel) { _ = _todoListService.CreateTask(requestModel); return(CreatedAtRoute("GetTaskById", new { id = requestModel.Id }, requestModel)); }