Example #1
0
        public void CreateBestTime(BestTimeFormModel bestTimeFormModel)
        {
            var bestTime = mapper.Map <BestTime>(bestTimeFormModel);

            bestTimeRepository.Insert(bestTime);
            bestTimeRepository.Commit();
        }
Example #2
0
        public IActionResult Create([FromForm] BestTimeFormModel bestTime)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction(nameof(Error)));
            }

            bestTimesService.CreateBestTime(bestTime);
            return(RedirectToAction(nameof(Index)));
        }