Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Response Execute(Request request)
- {
- ThrowIf.Null(request, "request");
- Type type = request.GetType();
- if (type == typeof(SaveCustomerServiceRequest))
- {
- return SaveCustomer((SaveCustomerServiceRequest)request);
- }
- if (type == typeof(GetCustomersServiceRequest))
- {
- return GetCustomers((GetCustomersServiceRequest)request);
- }
- if (type == typeof(CustomersSearchServiceRequest))
- {
- return SearchCustomers((CustomersSearchServiceRequest)request);
- }
- if (type == typeof(CustomerSearchByFieldsServiceRequest))
- {
- return SearchByFields((CustomerSearchByFieldsServiceRequest)request);
- }
- if (type == typeof(GetCustomerSearchFieldsServiceRequest))
- {
- return GetCustomerSearchFields((GetCustomerSearchFieldsServiceRequest)request);
- }
- if (type == typeof(GetCustomerGroupsServiceRequest))
- {
- return GetCustomerGroups((GetCustomerGroupsServiceRequest)request);
- }
- if (type == typeof(InitiateLinkToExistingCustomerServiceRequest))
- {
- return InitiateLinkToExistingCustomer((InitiateLinkToExistingCustomerServiceRequest)request);
- }
- if (type == typeof(FinalizeLinkToExistingCustomerServiceRequest))
- {
- return FinalizeLinkToExistingCustomer((FinalizeLinkToExistingCustomerServiceRequest)request);
- }
- if (type == typeof(UnlinkFromExistingCustomerServiceRequest))
- {
- return UnlinkFromExistingCustomer((UnlinkFromExistingCustomerServiceRequest)request);
- }
- if (type == typeof(GetCustomerBalanceServiceRequest))
- {
- return GetBalance((GetCustomerBalanceServiceRequest)request);
- }
- if (type == typeof(GetOrderHistoryServiceRequest))
- {
- return GetOrderHistory((GetOrderHistoryServiceRequest)request);
- }
- if (type == typeof(GetValidatedCustomerAccountNumberServiceRequest))
- {
- return ValidateCustomerAccountNumber((GetValidatedCustomerAccountNumberServiceRequest)request);
- }
- if (type == typeof(GetPurchaseHistoryServiceRequest))
- {
- return GetPurchaseHistory((GetPurchaseHistoryServiceRequest)request);
- }
- if (type == typeof(GetShipmentHistoryServiceRequest))
- {
- return GetOrderShipmentsHistory((GetShipmentHistoryServiceRequest)request);
- }
- throw new NotSupportedException($"Request '{request.GetType()}' is not supported.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement