private int GetNewRandomSkierIdForRace(Race race) { Skier[] skierArray = adoSkierDao.FindAll().ToArray(); Random random = new Random(); int index = random.Next(0, skierArray.Length); while (!SkierAllowedForRace(race, skierArray[index])) { index = random.Next(0, skierArray.Length); } return(skierArray[index].Id); }
public ActionResult <IEnumerable <SkierOutDto> > GetAll() { IEnumerable <Skier> skiers = _adoSkierDao.FindAll(); if (skiers == null) { return(NotFound()); } IList <SkierOutDto> skierDtos = new List <SkierOutDto>(); foreach (var skier in skiers) { skierDtos.Add(SkierOutDto.FromSkier(skier)); } return(Ok(skierDtos)); }
public void AdoSkierDaoTest() { Assert.True(skierDao.FindAll().Any()); }