public ActionResult Create(FormCollection post)
        {
            if (!string.IsNullOrEmpty(post["InputTodoWhat"]))
            {
                todoListService.CreateTask(post["InputTodoWhat"] as string);
            }

            return(RedirectToAction("List"));
        }
Example #2
0
        public ActionResult CreateTask(string taskTodo)
        {
            bool result = false;

            if (!string.IsNullOrEmpty(taskTodo))
            {
                result = todoListService.CreateTask(taskTodo);
            }
            return(Content(result.ToString()));
        }
Example #3
0
 public IActionResult CreateTask(TaskDto requestModel)
 {
     _ = _todoListService.CreateTask(requestModel);
     return(CreatedAtRoute("GetTaskById", new { id = requestModel.Id }, requestModel));
 }