public override async Task <List <LogisticStore> > GetItemsAsync(SystemSearchParameter systemSearch = null)
        {
            this.RunUrl = GlobalSetting.Instance.GatewayLogisticEndpoint + "/api/LogisticStoreAuthorize/MyStores";

            try
            {
                var httpclient = RequestProvider.CreateHttpClient();

                var token = await httpclient.ReadSystemAccessToken();

                httpclient = RequestProvider.CreateHttpClient(token);

                var searchurl = new UrlBuilder().Build(RunUrl, systemSearch);

                var searchresult = await httpclient.GetStringAsync(searchurl).ConfigureAwait(false);

                return(await Task.Run(() =>
                                      JsonConvert.DeserializeObject <List <LogisticStore> >(searchresult)));

                //  return base.GetItemsAsync(null);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Exemplo n.º 2
0
        public virtual async Task <List <T> > GetItemsAsync(SystemSearchParameter systemSearch)
        {
            var accesstoken = await RequestProvider.CreateHttpClient().ReadSystemAccessToken();

            return(await RequestProvider.GetAsync <List <T> >(RunUrl, systemSearch, accesstoken));

            // return  await Task.Run< List<T>>(() => JsonConvert.DeserializeObject<List<T>>(readresult)); ;
        }