private static EContactModel ParseEContacts(string jsonString) { EContactModel model = new EContactModel(); try { JArray a = JArray.Parse(jsonString); foreach (JObject i in a) { foreach (var p in i) { EContactItem eContactItem = new EContactItem(); eContactItem.Name = p.Key; eContactItem.Contact = (string)p.Value; model.EContactItems.Add(eContactItem); } } } catch (Exception) { throw new HttpRequestException("Internet connection is required to download the contact list for the first time"); } return(model); }
private static EContactModel ParseEContacts(string jsonString) { EContactModel model = new EContactModel(); try { JArray a = JArray.Parse(jsonString); foreach (JObject i in a) { foreach (var p in i) { EContactItem eContactItem = new EContactItem(); eContactItem.Name = p.Key; eContactItem.Contact = (string)p.Value; model.EContactItems.Add(eContactItem); } } } catch (Exception) { throw new HttpRequestException("Internet connection is required to download the contact list for the first time"); } return model; }