EasyBike.Models.ContractService.GetContractsAsync C# (CSharp) Method

GetContractsAsync() public method

public GetContractsAsync ( ) : Task>
return Task>
        public async Task<List<Contract>> GetContractsAsync()
        {
            if (contracts.Count == 0)
            {
                var storedContracts = (await _storageService.LoadStoredContractsAsync().ConfigureAwait(false)).ToList();

                foreach (var contract in storedContracts)
                {
                    foreach (var station in contract.Stations)
                    {
                        station.Contract = contract;
                        station.IsUiRefreshNeeded = true;
                        stations.Add(station);
                    }
                }
                contracts = storedContracts;
                StartRefreshAsync();
            }
            return contracts;
        }