Пример #1
0
        public ActionResult <SkierOutDto> Insert(SkierInDto skierInDto)
        {
            Skier skier = SkierInDto.ToSkier(skierInDto);
            var   rowid = _adoSkierDao.Insert(skier);

            return(Ok());
        }
Пример #2
0
 public static Skier ToSkier(SkierInDto skierInDto)
 {
     return(new Skier()
     {
         FirstName = skierInDto.FirstName,
         LastName = skierInDto.LastName,
         DateOfBirth = skierInDto.DateOfBirth,
         Nation = skierInDto.Nation,
         ProfileImage = skierInDto.ProfileImage,
         Sex = skierInDto.Sex
     });
 }
Пример #3
0
        public ActionResult <SkierOutDto> Update(int id, SkierInDto skierInDto)
        {
            Skier skier = SkierInDto.ToSkier(skierInDto);

            skier.Id = id;
            _adoSkierDao.Update(skier);
            var updatedSkier = _adoSkierDao.FindById(id);

            if (updatedSkier == null)
            {
                return(NotFound());
            }
            return(Ok(SkierOutDto.FromSkier(updatedSkier)));
        }