コード例 #1
0
        public IActionResult PostTodoModels(taskViewModel taskItem)
        {
            Task postedTask = new Task()
            {
                Title    = taskItem.Title,
                TimeLeft = TimeSpan.Parse(taskItem.TimeLeft)
            };

            SHARED.ViewModals.Task postData = ModelToDto.ModelToDTO(postedTask);
            SHARED.ViewModals.Task result   = taskBLL.PostTasks(postData);

            return(Created("", result));
        }
コード例 #2
0
        public IActionResult PutTodoModel(int id, taskViewModel todoModel)
        {
            Task editedTask = new Task()
            {
                TaskId      = todoModel.TaskId,
                Title       = todoModel.Title,
                TimeLeft    = TimeSpan.Parse(todoModel.TimeLeft),
                IsCompleted = todoModel.IsCompleted,
                IsDeleted   = todoModel.IsDeleted,
                IsExpired   = todoModel.IsExpired
            };

            SHARED.ViewModals.Task editdata  = ModelToDto.ModelToDTO(editedTask);
            SHARED.ViewModals.Task tasksItem = taskBLL.EditTasks(id, editdata);

            return(Created("", tasksItem));
        }