public GetCountrySubdivisionResponse GetCountrySubdivision(string location, GetCountrySubdivisionRequest req)
        {
            var agent = _agents.GetAgent(location);

            _agentConnectConfig.DecorateRequest(req);
            return(_testRunner.AgentConnect.GetCountrySubdivision(agent, req));
        }
        public GetCountrySubdivisionResponse GetCountrySubdivision(GetCountrySubdivisionRequest req)
        {
            var agent = AuthIntegration.GetAgent();

            var acStatesResponse = _agentConnect.GetCountrySubdivision(agent, req);

            return(acStatesResponse);
        }
Exemple #3
0
 public virtual async Task <GetCountrySubdivisionResponse> GetCountrySubdivisionAsync(Agent agent, GetCountrySubdivisionRequest getCountrySubdivisionRequest)
 {
     return(await AgentConnect.GetCountrySubdivisionAsync(agent, getCountrySubdivisionRequest));
 }
Exemple #4
0
 public virtual GetCountrySubdivisionResponse GetCountrySubdivision(Agent agent, GetCountrySubdivisionRequest getCountrySubdivisionRequest)
 {
     return(AgentConnect.GetCountrySubdivision(agent, getCountrySubdivisionRequest));
 }
        public IHttpActionResult Subdivisions([FromBody] GetCountrySubdivisionRequest reqVm)
        {
            var resp = _lookupBusiness.GetCountrySubdivision(reqVm);

            return(Ok(resp));
        }
        public override GetCountrySubdivisionResponse GetCountrySubdivision(Agent agent, GetCountrySubdivisionRequest getCountrySubdivisionRequest)
        {
            GetCountrySubdivisionResponse countrySubdivisionResponse;
            var countrySubdivisionKeyFormatted = string.Format(CacheKeys.COUNTRYSUBDIVISIONKEY, agent.Language);
            var cachedResult = _cacheManager.Contains <CachedObjectResponseContainer <GetCountrySubdivisionResponse> >(countrySubdivisionKeyFormatted, CacheRegion.Global);

            Func <GetCountrySubdivisionResponse> countrySubdivisionCacheSaveFunction = delegate()
            {
                var version = getCountrySubdivisionRequest.CachedVersion;
                getCountrySubdivisionRequest.CachedVersion = null;

                countrySubdivisionResponse = base.GetCountrySubdivision(agent, getCountrySubdivisionRequest);
                var CachedContainer = CacheAheadHelper.PopulateCacheMetadata(countrySubdivisionResponse, CachePolicies.FullWeek);
                _cacheManager.Save(countrySubdivisionKeyFormatted, CachedContainer, CacheRegion.Global, CachePolicies.FullWeek);

                getCountrySubdivisionRequest.CachedVersion = version;
                return(countrySubdivisionResponse);
            };

            if (cachedResult.Exists)
            {
                CacheAheadHelper.ExecuteCacheAheadProcess <GetCountrySubdivisionResponse>(countrySubdivisionCacheSaveFunction, cachedResult.CachedObj.CacheMetadata);
                if (getCountrySubdivisionRequest.CachedVersion != cachedResult.CachedObj.DataObject.Payload.Version)
                {
                    countrySubdivisionResponse = cachedResult.CachedObj.DataObject;
                }
                else
                {
                    countrySubdivisionResponse = new GetCountrySubdivisionResponse {
                        Payload = new GetCountrySubdivisionResponsePayload {
                            Version = getCountrySubdivisionRequest.CachedVersion
                        }
                    };
                }
            }
            else
            {
                countrySubdivisionResponse = countrySubdivisionCacheSaveFunction();
            }

            return(countrySubdivisionResponse);
        }
Exemple #7
0
        /// <summary>
        /// Get country info by lookup key
        /// </summary>
        /// <param name="getCountrySubdivisionReq"></param>
        /// <returns></returns>
        public GetCountrySubdivisionResponse GetCountrySubdivision(string agentLocation, GetCountrySubdivisionRequest getCountrySubdivisionReq)
        {
            var getCountrySubdivisionResp = _acIntegration.GetCountrySubdivision(agentLocation, getCountrySubdivisionReq);

            return(getCountrySubdivisionResp);
        }
Exemple #8
0
        public AcApiResponse <GetCountrySubdivisionResponse, ApiData> GetCountrySubdivision(GetCountrySubdivisionRequest req)
        {
            var resp = _agentConnectIntegration.GetCountrySubdivision(req);

            var apiResp = new AcApiResponse <GetCountrySubdivisionResponse, ApiData>
            {
                BusinessMetadata = MapperHelper.SetResponseProperties(resp.Payload?.Flags, DataSource.AgentConnect),
                ResponseData     = resp
            };

            return(apiResp);
        }