protected override async Task OnParametersSetAsync() { _raceModelsList = await RaceRepository.GetRaces(); _raceTabs = GetRaceTabDictionary(_raceModelsList); await ResetStats(); }
public IHttpActionResult GetRaces() { var races = raceRepository.GetRaces(); var racesDto = races .Select(Mapper.Map <Race, RaceDto>).ToList(); return(Ok(racesDto)); }
private IEnumerable <LightRaceViewModel> InitializeRaces() { var races = raceRepository.GetRaces(); var viewmodels = new List <LightRaceViewModel>(); races.ForEach(r => viewmodels.Add(LightRaceViewModel.CreateFromModel(r))); return(viewmodels); }
public ActionResult Index() { var races = raceRepository.GetRaces(); var viewModel = new List <RaceViewModel>(); races.ForEach(r => viewModel.Add(RaceViewModel.RaceViewModelCreation(r))); return(View(viewModel)); }
public IActionResult Index() { //List<Province> provinceList = new List<Province>(); var provinceRepository = new ProvinceRepository(); var geographyRepository = new GeographyRepository(); var raceRepository = new RaceRepository(); ViewBag.ProvinceList = provinceRepository.GetProvinces().OrderBy(Province => Province.Name); ViewBag.GeographyList = geographyRepository.GetGeography().OrderBy(Geography => Geography.Name); ViewBag.RaceList = raceRepository.GetRaces().OrderBy(Race => Race.Name); return(View()); }
public void GetRaces_Returns_CorrectNumber() { Assert.AreEqual(5, raceRepository.GetRaces().Count()); }