Пример #1
0
        public IActionResult AddToDoItem(ToDoItem task)
        {
            if (ModelState.IsValid)
            {
                task.UserId = User.FindFirstValue(ClaimTypes.NameIdentifier);
                _taskRepository.AddTask(task);

                return(RedirectToAction("TaskAdded"));
            }

            return(View(task));
        }
Пример #2
0
 public bool CompleteTask(ToDoItem task)
 {
     return(CompleteTaskById(task.Id));
 }
Пример #3
0
 private ToDoItem UpdateLastModifiedDateTime(ToDoItem task)
 {
     task.LastTimeModified = DateTime.UtcNow;
     return(task);
 }
Пример #4
0
 public bool RemoveTask(ToDoItem task)
 {
     return(RemoveTaskById(task.Id));
 }