inBloomApiLibrary.SectionDataService.GetSectionStudentAssociationStudentListAsync C# (CSharp) Method

GetSectionStudentAssociationStudentListAsync() public method

Gets students details in student section associations within the sections asynchronously.
public GetSectionStudentAssociationStudentListAsync ( string accessToken, string sectionId, int limit, int offset, string views ) : Task
accessToken string
sectionId string
limit int Max number of sections to return(optional)
offset int Starting position of result set(optional)
views string View name (optional)
return Task
        public async Task<JArray> GetSectionStudentAssociationStudentListAsync(string accessToken, string sectionId, int? limit, int? offset, string views)
        {
            Uri apiEndPoint = new Uri(String.Format(ApiHelper.BaseUrl + "/sections/{0}/studentSectionAssociations/students", sectionId));
            if (limit != null) { apiEndPoint = apiEndPoint.AddQuery("limit", limit.ToString()); }
            if (offset != null) { apiEndPoint = apiEndPoint.AddQuery("offset", offset.ToString()); }
            if (!string.IsNullOrEmpty(views)) { apiEndPoint = apiEndPoint.AddQuery("views", views); }
            return (await ApiHelper.CallApiForGetAsync(apiEndPoint.ToString(), accessToken));
        }

Usage Example

コード例 #1
0
 public async Task<ActionResult> GetStudentsAsync(string sectionId, int? limit, int? offset, string view)
 {
     if (string.IsNullOrEmpty(sectionId))
     {
         return RedirectToAction("IndexAsync");
     }
     try
     {
         var sectionService = new SectionDataService();
         return View("GetStudents", await sectionService.GetSectionStudentAssociationStudentListAsync(SessionInfo.Current.AccessToken, sectionId, limit, offset, view));
     }
     catch(Exception ex)
     {
         Trace.TraceError(ex.Message);
         ViewBag.Error = ex.Message;
         return Content("No students found");
     }
 }