public async Task <ActionResult <IEnumerable <PersonAllocation> > > ListPlaceAllocations( [FromQuery] string placeId ) { try { if (string.IsNullOrEmpty(placeId)) { throw new ArgumentNullException(nameof(placeId)); } if (!await User.IsPlaceAdmin(userRepository, placeProviderRepository, placeRepository, placeId)) { throw new Exception("Only place provider admin can assign person to place"); } return(Ok(await placeProviderRepository.ListAllocations(placeId))); } catch (ArgumentException exc) { logger.LogError(exc.Message); return(BadRequest(new ProblemDetails() { Detail = exc.Message })); } catch (Exception exc) { logger.LogError(exc, exc.Message); return(BadRequest(new ProblemDetails() { Detail = exc.Message })); } }