Example #1
0
        public ActionResult InsertOrUpdate(int?id = null)
        {
            var viewModel = new AlbumViewModel(id);

            viewModel.Prepare();
            return(View(viewModel));
        }
Example #2
0
 public ActionResult InsertOrUpdate(AlbumViewModel model)
 {
     if (!ModelState.IsValid)
     {
         model.Prepare();
         return(View(model));
     }
     model.Save();
     return(RedirectToAction("List"));
 }