Beispiel #1
0
        //Stworzenie wyszukiwacza do WebApi, gdzie wpisujemy id gry i na wylistuje specjalnie dlc do niego
        //Powód: szybkość zmiany oceny danego DLC
        public static async Task <bool> AddDlc(UserDlc userDlcs)
        {
            using (HttpClient client = new HttpClient())
            {
                var json     = JsonConvert.SerializeObject(userDlcs);
                var content  = new StringContent(json, Encoding.UTF8, "application/json");
                var response = await client.PostAsync("https://collectorgameapp.azurewebsites.net/api/dlc", content);

                return(response.IsSuccessStatusCode);
            }
        }
Beispiel #2
0
        public static async Task <bool> EditDlcRate(int id, UserDlc userDlc)
        {
            using (HttpClient client = new HttpClient())
            {
                var json     = JsonConvert.SerializeObject(userDlc);
                var content  = new StringContent(json, Encoding.UTF8, "application/json");
                var response = await client.PutAsync(String.Concat(
                                                         "https://collectorgameapp.azurewebsites.net/RateDlc/", id), content);

                return(response.IsSuccessStatusCode);
            }
        }