示例#1
0
        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);
        }
示例#2
0
        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));
        }
示例#3
0
 public void AdoSkierDaoTest()
 {
     Assert.True(skierDao.FindAll().Any());
 }