예제 #1
0
        public async Task <ActionResult <ParticipantsDTO[]> > GetParticipantsByEventId(int EventId)
        {
            {
                try
                {
                    var eEvent = await _participantsRepository.GetEventParticipantsByEventIdAsync(EventId);

                    if (eEvent == null)
                    {
                        return(NotFound());
                    }

                    return(Ok(_mapper.Map <ParticipantsDTO[]>(eEvent)));
                }
                catch (Exception)
                {
                    return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
                }
            }
        }