public ActionResult <SkierOutDto> Insert(SkierInDto skierInDto) { Skier skier = SkierInDto.ToSkier(skierInDto); var rowid = _adoSkierDao.Insert(skier); return(Ok()); }
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 }); }
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))); }