public ActionResult ViewAllAlbums() { var albumRepo = new AlbumRepo(); var albums = albumRepo.GetAll().Select(x => new Album(x)).ToList(); return(PartialView(albums)); }
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)); }
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())); }