Пример #1
0
        public async Task <Result <PriceRequestError, Models.Prices> > GetPriceAsync(GasStationId gasStationId)
        {
            var response = await new PriceRequest(new List <GasStationId>()
            {
                gasStationId
            }, TankerkoenigBaseUrl, ApiKey).Invoke();
            var hasPrices = (response as PriceResponse).Prices.TryGetValue(gasStationId, out var prices);

            if (hasPrices)
            {
                return(prices);
            }

            return(null);
        }
Пример #2
0
        public async Task <DetailedResponse> GetDetailsAsync(GasStationId gasStationId)
        {
            var response = await new DetailsRequest(gasStationId, TankerkoenigBaseUrl, ApiKey).Invoke();

            return(response as DetailedResponse);
        }