public IActionResult Details(int id) { ViewBag.Categories = new SelectList(CategoryRepository.GetAll(), "Id", "Name"); ViewBag.Genres = new SelectList(GenreRepository.GetAll(), "Id", "Name"); var show = ShowRepository.GetById(id); return(View(show)); }
public IActionResult Details(int id) { var show = ShowRepository.GetById(id); ViewData["Category"] = CategoryRepository.GetById(show.CategoryId).Name; ViewData["Genre"] = GenreRepository.GetById(show.GenreId).Name; return(View(show)); }
public void Get_Returns_A_Show() { var expectedId = 1; repo.GetById(expectedId).Returns(new Show() { ShowId = expectedId }); var result = underTest.Get(expectedId); Assert.Equal(expectedId, result.Value.ShowId); }
public async Task <TicketViewModel> BookTicket(Guid showId, Guid userId) { try { var show = await _showRepository.GetById(showId); if (show.Tickets.Count >= show.TicketCount) { return(null); } return(await _ticketRepository.BookTicket(show, userId)); } catch (Exception ex) { _logger.LogError(ex.Message); return(null); } }
public async Task <Show> GetShow(Guid showId) { return(await _showRepository.GetById(showId)); }
public ActionResult <Show> Get(int id) { var show = repo.GetById(id); return(show); }