예제 #1
0
        public async Task <ActionResult <ParticipantsDTO[]> > GetAllEventsWithParticipants()
        {
            try
            {
                var eventsParticipants = await _participantsRepository.GetAllEventsWithParticipantsAsync();

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