public async Task <ActionResult <ParticipantsDTO[]> > GetEventsByParticipantsId(int UserId) { { try { var eEvent = await _participantsRepository.GetEventsByParticipantsIdAsync(UserId); if (eEvent == null) { return(NotFound()); } return(Ok(_mapper.Map <ParticipantsDTO[]>(eEvent))); } catch (Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } } }