Example #1
0
 /// <summary>
 /// </summary>
 /// <param name="id">
 /// The id.
 /// </param>
 /// <returns>
 /// </returns>
 public GenreDetailsViewModel GetGenreDetailsViewModel(int id)
 {
     using (var repository = Factory.GetGenreRepository())
     {
         var genre = repository.GetById(id);
         return(ModelsMapper.GetGenreDetailsViewModel(genre));
     }
 }
Example #2
0
        /// <summary>
        /// </summary>
        /// <param name="genreId">
        ///     The genre id.
        /// </param>
        /// <returns>
        /// </returns>
        public virtual ActionResult Details(int id)
        {
            using (var repository = RepositoryFactory.GetGenreRepository())
            {
                var model = repository.GetById(id);
                if (model == null)
                {
                    return(View("_NotFound"));
                }

                var viewModel = ModelsMapper.GetGenreDetailsViewModel(model);
                return(View(viewModel));
            }
        }