public IndustryResponse Industry(string location, IndustryRequest req)
        {
            var agent = _agents.GetAgent(location);

            _agentConnectConfig.DecorateRequest(req);
            return(_testRunner.AgentConnect.Industry(agent, req));
        }
        public override IndustryResponse Industry(Agent agent, IndustryRequest request)
        {
            IndustryResponse industriesResponse;
            var industryKeyFormatted = string.Format(CacheKeys.INDUSTRYKEY, agent.Language);
            var result = _cacheManager.Contains <CachedObjectResponseContainer <IndustryResponse> >(industryKeyFormatted, CacheRegion.Global);

            Func <IndustryResponse> industryCacheSaveFunction = delegate()
            {
                industriesResponse = base.Industry(agent, request);
                var CachedContainer = CacheAheadHelper.PopulateCacheMetadata <IndustryResponse>(industriesResponse, CachePolicies.FullWeek);

                _cacheManager.Save(industryKeyFormatted, CachedContainer, CacheRegion.Global, CachePolicies.FullWeek);
                return(industriesResponse);
            };

            if (result.Exists)
            {
                CacheAheadHelper.ExecuteCacheAheadProcess <IndustryResponse>(industryCacheSaveFunction, result.CachedObj.CacheMetadata);
                industriesResponse = result.CachedObj.DataObject;
            }
            else
            {
                industriesResponse = industryCacheSaveFunction();
            }
            return(industriesResponse);
        }
        public IHttpActionResult Industry([FromBody] IndustryRequest industryRequest)
        {
            industryRequest = industryRequest ?? new IndustryRequest();

            var industriesRespVm = _lookupBusiness.Industry(industryRequest);

            return(Ok(industriesRespVm));
        }
        public IndustryResponse Industry(IndustryRequest request)
        {
            var agent = AuthIntegration.GetAgent();

            var industryResponse = _agentConnect.Industry(agent, request);

            return(industryResponse);
        }
Beispiel #5
0
        public AcApiResponse <IndustryResponse, ApiData> Industry(IndustryRequest req)
        {
            var resp = _agentConnectIntegration.Industry(req);

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

            return(apiResp);
        }
        /// <summary>
        ///     Get Industries
        /// </summary>
        /// <param name="agentLocation"></param>
        /// <returns></returns>
        public IndustryResponse Industry(string agentLocation)
        {
            var request = new IndustryRequest();

            return(_acIntegration.Industry(agentLocation, request));
        }
Beispiel #7
0
 public virtual async Task <IndustryResponse> IndustryAsync(Agent agent, IndustryRequest industryRequest)
 {
     return(await AgentConnect.IndustryAsync(agent, industryRequest));
 }
Beispiel #8
0
 public virtual IndustryResponse Industry(Agent agent, IndustryRequest industryRequest)
 {
     return(AgentConnect.Industry(agent, industryRequest));
 }