List <FbSchool> parseEducation(JArray schools, string userId) { List <FbSchool> result = new List <FbSchool>(); foreach (JObject school in schools) { if (null != school["school"]) { FbSchool s = new FbSchool(); s.UserID = userId; s.Name = (string)school["school"]["name"]; s.SchoolID = (string)school["school"]["id"]; s.Type = school["type"] != null ? (string)school["type"] : ""; s.Year = school["year"] != null ? (string)school["year"]["name"] : ""; result.Add(s); } } return(result); }
List<FbSchool> parseEducation(JArray schools, string userId) { List<FbSchool> result = new List<FbSchool>(); foreach (JObject school in schools) { if (null != school["school"]) { FbSchool s = new FbSchool(); s.UserID = userId; s.Name = (string)school["school"]["name"]; s.SchoolID = (string)school["school"]["id"]; s.Type = school["type"] !=null ? (string)school["type"] : ""; s.Year = school["year"] != null ? (string)school["year"]["name"] : ""; result.Add(s); } } return result; }
private static string buildSchoolRecord(FbSchool s) { string schoolLine = string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",{4}", s.UserID, s.SchoolID, s.Name, s.Type, s.Year); return schoolLine; }
private static string buildSchoolRecord(FbSchool s) { string schoolLine = string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",{4}", s.UserID, s.SchoolID, s.Name, s.Type, s.Year); return(schoolLine); }