public void SaveProfilesToAPI(IEnumerable <MouseProfileModel> profiles) { settings.TypeNameHandling = TypeNameHandling.None; string data = JsonConvert.SerializeObject(profiles, settings); var response = MouseProfileAPI.PostInsertData(client, data).GetAwaiter().GetResult(); var str = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); }
public IEnumerable <MouseProfileModel> GetProfilesFromAPI() { var response = MouseProfileAPI.GetAllProfiles(client).GetAwaiter().GetResult(); if (!response.IsSuccessStatusCode) { return(null); } var json = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); return(JsonConvert.DeserializeObject <IEnumerable <MouseProfileModel> >(json)); }