public async Task <TaskHistory> CompleteTask(Core.Task_Management_System.Entities.Task task) { var taskHistory = new TaskHistory { UserId = task.UserId, Title = task.Title, Description = task.Description, DueDate = task.DueDate, Completed = DateTime.Now, Remarks = task.Remarks }; var createdTaskHistory = await _taskHistoryRepository.AddAsync(taskHistory); await _taskRepository.DeleteAsync(task); return(createdTaskHistory); }
public async Task <IActionResult> CompleteTask(Core.Task_Management_System.Entities.Task task) { var taskHistory = await _userService.CompleteTask(task); return(Ok(taskHistory)); }
public async Task <IActionResult> CreateTask(Core.Task_Management_System.Entities.Task task) { var createdTask = await _userService.CreateTask(task); return(Ok(createdTask)); }
public async Task <Core.Task_Management_System.Entities.Task> CreateTask(Core.Task_Management_System.Entities.Task task) { return(await _taskRepository.AddAsync(task)); }