public IActionResult Index() { List <TicketsVM> model = _repo.GetAll().OrderByDescending(p => p.Tier).Select(p => new TicketsVM { Id = p.ID, Name = p.Name, Price = p.Price, Description = p.Description, Tier = p.Tier }).ToList(); return(View(model)); }
public IActionResult List() { List <TicketTypeListVM> Model = _repo.GetAll().Select(p => new TicketTypeListVM { Id = p.ID, Name = p.Name, Price = p.Price, TicketsBought = _repo.GetNumberOfTicketsBought(p.ID), Description = p.Description }).ToList(); return(View(Model)); }
public async Task <ActionResult> GetAll() { try { var ticketTypes = await _ticketTypeRepository.GetAll(); if (ticketTypes != null) { return(Ok(ticketTypes)); } else { return(NoContent()); } } catch (Exception ex) { return(Problem(ex.Message)); } }
public IEnumerable <TicketTypeViewModel> GetAll() { return(_mapper.Map <IEnumerable <TicketTypeViewModel> >(_ticketTypeRepository.GetAll())); }
public IQueryable <TicketType> GetAllTicketType(Expression <Func <TicketType, bool> > where, params Expression <Func <TicketType, object> >[] includes) { return(_iRespository.GetAll(where, includes)); }
private SelectList GetTicketTypesAsSelectList() { return(new SelectList(_ticketTypeRepository.GetAll(), nameof(TicketType.id), nameof(TicketType.Naam))); }
public IEnumerable <TicketType> GetAllTicketTypes() { return(ticketTypeRepository.GetAll()); }