Пример #1
0
 public static async Task <HttpResponseMessage> Update(LanguageDto data)
 {
     using (var client = ProjectNameApiClient.Get())
     {
         return(await client.PutAsync("Language", ProjectNameApiClient.ConvertToContent(data)));
     }
 }
Пример #2
0
 public static async Task <HttpResponseMessage> Delete(LanguageDto data)
 {
     using (var client = ProjectNameApiClient.Get())
     {
         return(await client.DeleteAsync($"Language/{data.Id}"));
     }
 }
Пример #3
0
        public static async Task <List <LanguageDto> > GetById(int Id)
        {
            using (var client = ProjectNameApiClient.Get())
            {
                var response = await client.GetAsync($"Language/{Id}");

                var json = await response.Content.ReadAsStringAsync();

                return(JsonConvert.DeserializeObject <List <LanguageDto> >(json));
            }
        }