Beispiel #1
0
        private async Task <SearchRequestEntity> LinkSearchRequestRef(SearchRequestEntity searchRequest, CancellationToken cancellationToken)
        {
            //find agencyCode in ssg_agency entity
            string code   = searchRequest.AgencyCode;
            var    agency = await _oDataClient.For <SSG_Agency>()
                            .Filter(x => x.AgencyCode == code)
                            .FindEntryAsync(cancellationToken);

            searchRequest.Agency = agency;

            //find reasoncode
            var reason = await GetSearchReason(searchRequest.SearchReasonCode, cancellationToken);

            searchRequest.SearchReason = reason;

            var officeLocation = await GetSearchAgencyLocation(searchRequest.AgencyOfficeLocationText, code, cancellationToken);

            searchRequest.AgencyLocation = officeLocation;
            if (officeLocation != null)
            {
                searchRequest.AgencyOfficeLocationText = null;
            }
            return(searchRequest);
        }
Beispiel #2
0
        public async Task <SSG_SearchRequest> CreateSearchRequest(SearchRequestEntity searchRequest, CancellationToken cancellationToken)
        {
            SearchRequestEntity linkedSearchRequest = await LinkSearchRequestRef(searchRequest, cancellationToken);

            return(await this._oDataClient.For <SSG_SearchRequest>().Set(linkedSearchRequest).InsertEntryAsync(cancellationToken));
        }