private async Task <bool> UploadNames( ) { if (_foundPerson.Names == null) { return(true); } try { _logger.LogDebug($"Attempting to create found name records for SearchRequest[{_searchRequest.SearchRequestId}]"); foreach (var name in _foundPerson.Names) { AliasEntity n = _mapper.Map <AliasEntity>(name); n.SearchRequest = _searchRequest; n.InformationSource = _providerDynamicsID; n.Person = _returnedPerson; SSG_Aliase alias = await _searchRequestService.CreateName(n, _cancellationToken); await CreateResultTransaction(alias); } return(true); } catch (Exception ex) { LogException(ex); return(false); } }
private async Task <bool> UploadAliases(bool inUpdateProcess = false) { if (_personSought.Names == null) { return(true); } _logger.LogDebug($"Attempting to create aliases for SoughtPerson"); foreach (var name in _personSought.Names.Where(m => m.Owner == OwnerType.PersonSought)) { AliasEntity aliasEntity = _mapper.Map <AliasEntity>(name); aliasEntity.SearchRequest = _uploadedSearchRequest; aliasEntity.InformationSource = InformationSourceType.Request.Value; aliasEntity.Person = _uploadedPerson; aliasEntity.IsCreatedByAgency = true; aliasEntity.UpdatedByApi = inUpdateProcess; if (inUpdateProcess) { aliasEntity.UpdateDetails = "New Alias"; } await _searchRequestService.CreateName(aliasEntity, _cancellationToken); } _logger.LogInformation("Create alias records for SearchRequest successfully"); return(true); }
private async Task <bool> UploadNames(SSG_SearchRequest request, PersonSearchCompleted personCompletedEvent, CancellationToken concellationToken) { if (personCompletedEvent.MatchedPerson.Names == null) { return(true); } foreach (var name in personCompletedEvent.MatchedPerson.Names) { SSG_Aliase n = _mapper.Map <SSG_Aliase>(name); n.SearchRequest = request; n.InformationSource = personCompletedEvent.ProviderProfile.DynamicsID(); await _searchRequestService.CreateName(n, concellationToken); } return(true); }
private async Task <bool> UploadNames(Person person, SSG_SearchRequest request, SSG_Person ssg_person, int?providerDynamicsID, CancellationToken concellationToken) { if (person.Names == null) { return(true); } try { foreach (var name in person.Names) { SSG_Aliase n = _mapper.Map <SSG_Aliase>(name); n.SearchRequest = request; n.InformationSource = providerDynamicsID; n.Person = ssg_person; await _searchRequestService.CreateName(n, concellationToken); } return(true); } catch (Exception ex) { _logger.LogError(ex.Message); return(false); } }