public Task RefreshStationsAsync() { return(SafeExecuteAsync(async() => { var routes = await _stationService.GetAllStationsAsync(); RailwayStations.Clear(); RailwayStations.AddRange(routes); })); }
public override Task OnLoadedAsync() { UpdateCanSubmit(); return(SafeExecuteAsync(async() => { var stations = await _stationService.GetAllStationsAsync(); RailwayStations.Clear(); RailwayStations.AddRange(stations); int[] ids = _originalRoute.RailwayStations.Select(s => s.Id).ToArray(); RouteModel.RailwayStations.Clear(); RouteModel.RailwayStations.AddRange(RailwayStations.Where(s => ids.Contains(s.Id))); })); }