Beispiel #1
0
        public override async Task <GetCustomerAttributesResponse> Handle(GetCustomerAttributeRequest request, CancellationToken cancellationToken)
        {
            var attributes = await _cacheProvider.GetAttributes(cancellationToken);

            var customerAttributes = await _customerAttributeService.GetCustomerAttributes(request.CustomerId, cancellationToken);

            customerAttributes.ForEach(customerAttribute => customerAttribute.Attribute = _attributeService
                                                                                          .GetAttribute(attributes, customerAttribute.Id));

            var decryptedCustomAttributes = await Encryption.Decrypt <CustomerAttribute, CustomerAttributeDto>(customerAttributes);

            return(Response.Success <GetCustomerAttributesResponse>(decryptedCustomAttributes));
        }