Example #1
0
        public IEnumerable <VrstaDto> GetVrste()
        {
            HttpClient          httpClient          = GetHttpClient();
            UrlBuilder          urlBuilder          = new UrlBuilder(this.ApiSettings);
            HttpResponseMessage httpResponseMessage =
                httpClient.GetAsync(urlBuilder.Append("api/vrsta").GetUrl()).Result;

            return(JsonConvert.DeserializeObject <List <VrstaDto> >(httpResponseMessage.Content
                                                                    .ReadAsStringAsync().Result));
        }
Example #2
0
        public NaslovDto GetById(int id)
        {
            HttpClient          httpClient          = GetHttpClient();
            UrlBuilder          urlBuilder          = new UrlBuilder(this.ApiSettings);
            HttpResponseMessage httpResponseMessage =
                httpClient.GetAsync(urlBuilder.Append(ControllerName).Append("get").Append(id.ToString()).GetUrl()).Result;

            return(JsonConvert.DeserializeObject <NaslovDto>(httpResponseMessage.Content
                                                             .ReadAsStringAsync().Result));
        }
Example #3
0
        public IEnumerable <EvidencijaDugovanjaDto> GetEvidencijuDugovanja(int id)
        {
            HttpClient          httpClient          = GetHttpClient();
            UrlBuilder          urlBuilder          = new UrlBuilder(this.ApiSettings);
            HttpResponseMessage httpResponseMessage =
                httpClient.GetAsync(urlBuilder.Append("api/evidencijadugovanja/getbynaslov").Append(id.ToString()).GetUrl()).Result;

            return(JsonConvert.DeserializeObject <List <EvidencijaDugovanjaDto> >(httpResponseMessage.Content
                                                                                  .ReadAsStringAsync().Result));
        }