public IActionResult Add(AddVenueViewModel model) { var venue = new Venue { Description = model.Description }; _venueService.AddVenue(venue); return(View("Index", new VenueListViewModel { VenueList = _venueService.GetVenues().ToList() })); }
public IActionResult Add(AddVenueViewModel addVenueViewModel) { if (ModelState.IsValid) { Venue newVenue = new Venue { Name = addVenueViewModel.Name, Capacity = addVenueViewModel.Capacity, Price = addVenueViewModel.Price }; context.Add(newVenue); context.SaveChanges(); return Redirect("/Venue/ViewVenue/" + newVenue.ID); } return View(addVenueViewModel); }
public IActionResult Add() { AddVenueViewModel addVenueViewModel = new AddVenueViewModel(); return View(addVenueViewModel); }