private async Task RefreshAsync() { _appInsightsService.LogEvent("farmers/display", "Displaying farmers from local repository!"); // Loading the farmers from the repository var farmers = await _farmerRepo.GetFarmers(); var farmersObservable = new ObservableCollection <FarmerModel>(farmers); // Next add them to the observable collection of this view model Execute.OnUIThread(() => { this.Farmers = farmersObservable; }); }
public async Task <IEnumerable <FarmerModel> > GetFarmerListAsync() { return(await _FarmerRepository.GetFarmers().MapQueryTo <FarmerModel>(_mapper).ToListAsync()); }