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