public async Task <Submission[]> GetAssignmentSubmissions(string sectionId, string assignmentId) { var result = await educationServiceClient.GetAssignmentSubmissionsAsync(sectionId, assignmentId); foreach (var item in result) { if (null != item.SubmittedBy.User && !string.IsNullOrEmpty(item.SubmittedBy.User.Id)) { item.SubmittedBy.User.DisplayName = await GetUsername(item.SubmittedBy.User.Id); } if (!string.IsNullOrEmpty(item.SubmittedDateTime)) { item.SubmittedDateTime = Convert.ToDateTime(item.SubmittedDateTime).ToShortDateString(); } else { item.SubmittedDateTime = ""; } item.Resources = (await educationServiceClient.GetSubmissionResourcesAsync(sectionId, assignmentId, item.Id)).ToList(); } return(result); }