Example #1
0
        public ActionResult ViewAllAlbums()
        {
            var albumRepo = new AlbumRepo();
            var albums    = albumRepo.GetAll().Select(x => new Album(x)).ToList();

            return(PartialView(albums));
        }
Example #2
0
        public ActionResult Index()
        {
            List <AlbumEntity> albumEntities = AlbumRepo.GetAll();

            List <AlbumModel> albumModels = new List <AlbumModel>();

            foreach (var albumEntity in albumEntities)
            {
                albumModels.Add(EntityModelMapper.EntityToModel(albumEntity));
            }

            return(View(albumModels));
        }
Example #3
0
        public ActionResult Index(AlbumModel album, string albumComment)
        {
            CommentModel commentModel = new CommentModel()
            {
                Comment     = albumComment,
                DateCreated = DateTime.Now,
                Album       = album,
            };

            var commentEntity = EntityModelMapper.ModelToEntity(commentModel);

            CommentRepo.NewAlbumComment(album.AlbumModelId, commentEntity);

            return(View(AlbumRepo.GetAll()));
        }