public async Task <IActionResult> AssignUserToTask(string username) { var task = await _taskService.FindTaskById(_taskId); var user = await _userService.GetUserByNickname(username); await _taskService.AddUserToTask(user.Id, _taskId); await _notificationService.FormNotification($"You were assigned to task \"{task.Title}\"", _link, user.Id); return(RedirectToAction("Index", new { taskId = _taskId })); }