private async Task RefreshRaces() { var raceService = new RaceService(); var allRaces = await raceService.GetAll(); while (_sampleDataSource.Races.Count() > 0) { _sampleDataSource.Races.RemoveAt(0); } foreach (var race in allRaces) { var sampleDataItem = new Race( race.Id, race.Date, race.Sequence, race.Type, race.Location, race.Comment, race.RaceResultSet ); _sampleDataSource.Races.Add(sampleDataItem); } }
// GET: api/Race public IHttpActionResult Get() { return(Ok(raceService.GetAll())); }