Пример #1
0
        public async Task <dto.FindAgentsResponse> FindAgent(dto.FindAgentRequestData findAgentRequestData)
        {
            var signature = !string.IsNullOrEmpty(await _sessionBag.Signature())
                    ? await _sessionBag.Signature()
                    : await _userSessionService.GetAnonymousSharedSignature();

            var mappedRequest = Mapper.Map <FindAgentRequestData>(findAgentRequestData);
            var response      = await _client.FindAgentsAsync(new FindAgentsRequest
            {
                ContractVersion        = _navApiContractVer,
                MessageContractVersion = _navMsgContractVer,
                Signature = signature,
                EnableExceptionStackTrace = false,
                FindAgentRequestData      = mappedRequest
            });

            return(Mapper.Map <dto.FindAgentsResponse>(response));
        }
        private async Task <Contracts.FindAgentsResponse> FindAgent(FindAgentRequestData findAgentRequestData)
        {
            var mappedRequest = Mapper.Map <nskam.FindAgentRequestData>(findAgentRequestData);
            var response      = await _agentClient.FindAgentsAsync(new FindAgentsRequest
            {
                ContractVersion        = _navApiContractVer,
                MessageContractVersion = _navMsgContractVer,
                Signature = await _sessionBag.Signature(),
                EnableExceptionStackTrace = false,
                FindAgentRequestData      = mappedRequest
            });

            return(Mapper.Map <Contracts.FindAgentsResponse>(response));
        }