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());
        }
Beispiel #2
0
 public IActionResult BuyTicket(int id)
 {
     try
     {
         Event e = eRepo.GetEventById(id);
         return(View(e));
     }
     catch
     {
         return(View("Error"));
     }
 }