public async Task <IActionResult> SetUserTasksToStatusMailed(int userTaskId) { UserTask userTask = await userTaskService.FindAsync(userTaskId); if (userTask == null) { ProblemDetails problem = new ProblemDetails { Title = "User task was not found.", Detail = "User task with this ID does not exist.", Instance = "CA523709-D2CB-4EC5-BE31-32758D2587D0" }; return(NotFound(problem)); } userTask.Status = UserTaskStatus.Mailed; userTaskService.Update(userTask); userTaskService.Save(); return(Ok()); }