Exemple #1
0
        public bool Update(VideoGameDto modelDto)
        {
            var mapper    = MapperToModel();
            var videoGame = mapper.Map <VideoGameDto, VideoGame>(modelDto);

            return(_videoGameRepository.Update(videoGame));
        }
Exemple #2
0
        public ActionResult Edit(VideoGame videoGame)
        {
            try
            {
                VideoGameRepository videoGameRepository = new VideoGameRepository();

                using (videoGameRepository)
                {
                    videoGameRepository.Update(videoGame);
                }
                return(RedirectToAction("Index"));
            }
            catch
            {
                // TODO: add view for error message
                return(View("Error"));
            }
        }