Пример #1
0
        private async Task<int> GetUpdatedMatrixEntryValue(Address origin, Address destinatoin)
        {
            var parameters = new DistanceMatrixParameters();
            parameters.Origins.Add(origin.ToString());
            parameters.Destinations.Add(destinatoin.ToString());

            ServiceResponse<int> response;
            try
            {
                response = await _matrixApi.GetAddressInfoAsync(parameters, InfoType.Duration);
                if (response.Success)
                {
                    return response.Value;
                }
            }
            catch (Exception)
            {
                throw;
            }
            throw new Exception("Could not get service response");
        }