public async Task <IActionResult> GetEventById([FromRoute] int id) { var eventItem = await _repository.GetEventById(id); if (eventItem != null) { return(Ok(_mapper.Map <EventReadDto>(eventItem))); } return(NotFound()); }
public IActionResult BuyTicket(int id) { try { Event e = eRepo.GetEventById(id); return(View(e)); } catch { return(View("Error")); } }