public async Task <IEnumerable <AssignmentGridModel> > GetAssignmentsGridInfo(int userId, ClaimTypes clientType) { List <Assignment> assignments; if (clientType == ClaimTypes.Student) { assignments = await _assignmentRepository.GetStudentAssignments(userId); } else { assignments = await _assignmentRepository.GetInstructorAssignments(userId); } return(assignments.Select(a => new AssignmentGridModel { AssignmentId = a.Id, CourseTitle = a.Course.Title, Description = a.Description, StartDate = a.StartDate, EndDate = a.EndDate, InstructorName = a.Instructor.FirstName + " " + a.Instructor.LastName + " " + a.Instructor.SecondName }).ToList()); }