private EntityDataServiceResponse <LoyaltyCard> GetCustomerLoyaltyCards(GetCustomerLoyaltyCardsDataRequest request)
            {
                ThrowIf.NullOrWhiteSpace(request.CustomerAccountNumber, "customerAccountNumber");

                ParameterSet parameters = new ParameterSet();

                parameters["@nvc_CustomerAccountNumber"] = request.CustomerAccountNumber;
                parameters["@nvc_CustomerDataAreaId"]    = request.RequestContext.GetChannelConfiguration().InventLocationDataAreaId;

                ReadOnlyCollection <LoyaltyCard> loyaltyCards;

                using (SqlServerDatabaseContext sqlServerDatabaseContext = new SqlServerDatabaseContext(request))
                {
                    loyaltyCards = sqlServerDatabaseContext.ExecuteNonPagedStoredProcedure <LoyaltyCard>(LoyaltySqlServerDataService.GetCustomerLoyaltyCardsSprocName, parameters);
                }

                return(new EntityDataServiceResponse <LoyaltyCard>(loyaltyCards.AsPagedResult()));
            }
            /// <summary>
            /// Executes the workflow to get the loyalty cards of a customer.
            /// </summary>
            /// <param name="request">The request.</param>
            /// <returns>The response.</returns>
            protected override GetCustomerLoyaltyCardsResponse Process(GetCustomerLoyaltyCardsRequest request)
            {
                ThrowIf.Null(request, "request");
                var validateCustomerAccountRequest  = new GetValidatedCustomerAccountNumberServiceRequest(request.CustomerAccountNumber, throwOnValidationFailure: true);
                var validateCustomerAccountResponse = this.Context.Execute <GetValidatedCustomerAccountNumberServiceResponse>(validateCustomerAccountRequest);

                if (validateCustomerAccountResponse.IsCustomerAccountNumberInContextDifferent)
                {
                    request.CustomerAccountNumber = validateCustomerAccountResponse.ValidatedAccountNumber;
                }

                // Call data service
                var loyaltyDataServiceRequest = new GetCustomerLoyaltyCardsDataRequest(request.CustomerAccountNumber)
                {
                    QueryResultSettings = request.QueryResultSettings
                };
                var loyaltyDataServiceResponse = this.Context.Runtime.Execute <EntityDataServiceResponse <LoyaltyCard> >(loyaltyDataServiceRequest, this.Context);

                return(new GetCustomerLoyaltyCardsResponse(loyaltyDataServiceResponse.PagedEntityCollection));
            }