public async Task <ActionResult <AssignmentDto> > GetAssignment( [FromRoute] Guid classroomId, [FromRoute] Guid lessonId, [FromRoute] Guid assignmentId ) { var user = (ApplicationUser)HttpContext.Items["ApplicationUser"]; Debug.Assert(user != null, nameof(user) + " != null"); try { var classroom = await _classroomService.FindAsync(classroomId); var authorization = await _authorizationService.AuthorizeAsync(User, classroom, "IsInClassroom"); if (!authorization.Succeeded) { return(Forbid()); } var assignment = await _assignmentService.FindAsync(assignmentId); return(Ok(assignment.ToDto())); } catch (Exception e) { Console.WriteLine(e); return(BadRequest()); } }