//Creates a new ViewModel using the selected Type public AdminEventEditViewModel CreateAdminEventEditViewModel(EventTypeEnum type) { AdminEventEditViewModel vm = new AdminEventEditViewModel { EventType = type }; var events = eventRepository.GetAllEvents(); switch (type) { case EventTypeEnum.Bands: vm.ObjectList = bandRepository.GetAllBands().ToList <object>(); vm.AdminBand = new AdminBand(); break; case EventTypeEnum.Concerts: vm.ObjectList = concertRepository.GetAllConcerts().ToList <object>(); vm.AdminConcert = CreateAdminConcert(); break; case EventTypeEnum.Restaurants: vm.ObjectList = CreateAdminRestaurantList(); vm.AdminRestaurant = CreateAdminRestaurant(); break; case EventTypeEnum.Locations: vm.Location = new Location(); vm.ObjectList = locationRepository.GetAllLocations().ToList <object>(); break; } return(vm); }
public IEnumerable <Band> Get([FromQuery(Name = "rating")] int rating, [FromQuery(Name = "year")] int year) { if (rating == 0 && year == 0) { return(bandRepository.GetAllBands()); } else { return(bandRepository.GetBandByQuery(rating, year)); } }
// GET: api/band public IEnumerable <Band> Get() { return(bandRepository.GetAllBands()); }
// // GET: /Album/Create public ActionResult Create() { ViewBag.PossibleBands = bandRepository.GetAllBands(); ViewBag.PossibleGenres = genreRepository.GetAllGenres(); return(View()); }
public async Task <IActionResult> Get() { return(new OkObjectResult(await _bandRepository.GetAllBands())); }
// // GET: /Bands/ public ViewResult Index() { return(View(bandRepository.GetAllBands(band => band.Albums, band => band.Artists))); }