public async Task <VisitResponse> AssignVisitAsync(int tripId, int locatableId) { try { await _visitRepository.AssignVisit(tripId, locatableId); await _unitOfWork.CompleteAsync(); Visit visit = await _visitRepository.FindByTripIdAndLocatableId(tripId, locatableId); return(new VisitResponse(visit)); } catch (Exception ex) { return(new VisitResponse($"An error ocurred while assigning Trip to Visit: {ex.Message}")); } }