Ejemplo n.º 1
0
        public ActionResult Create(GigFormViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                viewModel.Genres = _unitOfWork.Genres.GetGenres();
                return(View("GigForm", viewModel));
            }

            _unitOfWork.Gigs.Add(Gig.New(User.Identity.GetUserId(), viewModel.GetDateTime(), viewModel.Genre, viewModel.Venue));
            _unitOfWork.Complete();
            return(RedirectToAction("Mine", "Gigs"));
        }