Example #1
0
        public ActionResult Create(AlbumViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var album = viewModel.ConvertToAlbum(db);
                db.Album.Add(album);
                db.SaveChanges();

                return(RedirectToAction("Grid"));
            }
            return(View(viewModel));
        }