예제 #1
0
 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();
 }
예제 #2
0
        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));
        }