コード例 #1
0
        public ActionResult Create(FormCollection post)
        {
            if (!string.IsNullOrEmpty(post["InputTodoWhat"]))
            {
                todoListService.CreateTask(post["InputTodoWhat"] as string);
            }

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

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