public async Task <GetBicycleOutputDTO> GetBicycleInformation(string bikeId) { GetBicycleFunction bicycleFunction = new GetBicycleFunction { FromAddress = Variables.adminAddress, Gas = Variables.gas, BicycleId = bikeId }; GetBicycleOutputDTO details = await ContractHandler.QueryDeserializingToObjectAsync <GetBicycleFunction, GetBicycleOutputDTO>(bicycleFunction, null).ConfigureAwait(false); return(details); }
public async Task <ObservableCollection <Bicycle> > GetAvailableBicyclesFromDockingStationAsync(string dockingStation) { ObservableCollection <Bicycle> bicycles = new ObservableCollection <Bicycle>(); List <string> keys = await GetBicycleKeys().ConfigureAwait(false); foreach (string key in keys) { GetBicycleOutputDTO bicycleDetails = await GetBicycleInformation(key).ConfigureAwait(false); if (bicycleDetails.ReturnValue2) { bicycles.Add(new Bicycle { ID = key, Status = bicycleDetails.ReturnValue2 == true ? "Available" : "Not Available", DockdeAt = bicycleDetails.ReturnValue1 }); } } return(bicycles); }