private async Task LoadAllAsync(HttpQueryDispatcher dispatcher, HttpQueryDispatcher.Next next, ListAllCurrency listAll) { models.Clear(); if (!serverConnection.IsAvailable) { var items = await localStorage.LoadAsync(); if (items != null) { models.AddRange(items); return; } } if (dispatcher != null) { models.AddRange(await dispatcher.QueryAsync(listAll)); } else { models.AddRange((List <CurrencyModel>) await next(listAll)); } await localStorage.SaveAsync(models); }
private async Task LoadAllAsync(ListAllCurrency listAll, HttpQueryDispatcher.Next next) { models.Clear(); if (!network.IsOnline) { var items = await localStorage.LoadAsync(); if (items != null) { models.AddRange(items); return; } } models.AddRange((List <CurrencyModel>) await next(listAll)); await localStorage.SaveAsync(models); }