public async Task <IEnumerable <Participant> > GetParticipantsByUsernameAsync(string username) { try { var participants = await _bookingsApiClient.GetParticipantsByUsernameAsync(username); return(participants.Select(x => new Participant { Id = x.Id, Username = x.Username })); } catch (BookingsApiException e) { if (e.StatusCode == (int)HttpStatusCode.NotFound) { return(Enumerable.Empty <Participant>()); } throw; } }