/// <summary> /// function is used to get th district list /// </summary> /// <returns></returns> public ListItem[] GetDistrict() { //JArray DistrictResponse = JArray.Parse(RestApiHelper.CallApi("schools", this._accessToken)); JArray DistrictResponse = schoolData.GetSchools(this._accessToken); ListItem[] _listDistrict = new ListItem[DistrictResponse.Count]; for (int Index = 0; Index < DistrictResponse.Count(); Index++) { JToken Token = DistrictResponse[Index]; //JArray SchoolName = (JArray)Token["educationOrgIdentificationCode"]; String ParentEducation = _authenticateUser.GetStringWithoutQuote(Token["parentEducationAgencyReference"].ToString()); try { JObject DistrictOrgResponse = JObject.Parse(RestApiHelper.CallApi("educationOrganizations/" + ParentEducation, this._accessToken)); String DistrictName = _authenticateUser.GetStringWithoutQuote(DistrictOrgResponse["nameOfInstitution"].ToString()); if (!_listDistrict.Contains(new ListItem(DistrictName))) { _listDistrict[Index] = new ListItem(DistrictName); } } catch (Exception ex) { return null; } } return _listDistrict; }