Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. public Response Execute(Request request)
  2. {
  3. ThrowIf.Null(request, "request");
  4. Type type = request.GetType();
  5. if (type == typeof(SaveCustomerServiceRequest))
  6. {
  7. return SaveCustomer((SaveCustomerServiceRequest)request);
  8. }
  9. if (type == typeof(GetCustomersServiceRequest))
  10. {
  11. return GetCustomers((GetCustomersServiceRequest)request);
  12. }
  13. if (type == typeof(CustomersSearchServiceRequest))
  14. {
  15. return SearchCustomers((CustomersSearchServiceRequest)request);
  16. }
  17. if (type == typeof(CustomerSearchByFieldsServiceRequest))
  18. {
  19. return SearchByFields((CustomerSearchByFieldsServiceRequest)request);
  20. }
  21. if (type == typeof(GetCustomerSearchFieldsServiceRequest))
  22. {
  23. return GetCustomerSearchFields((GetCustomerSearchFieldsServiceRequest)request);
  24. }
  25. if (type == typeof(GetCustomerGroupsServiceRequest))
  26. {
  27. return GetCustomerGroups((GetCustomerGroupsServiceRequest)request);
  28. }
  29. if (type == typeof(InitiateLinkToExistingCustomerServiceRequest))
  30. {
  31. return InitiateLinkToExistingCustomer((InitiateLinkToExistingCustomerServiceRequest)request);
  32. }
  33. if (type == typeof(FinalizeLinkToExistingCustomerServiceRequest))
  34. {
  35. return FinalizeLinkToExistingCustomer((FinalizeLinkToExistingCustomerServiceRequest)request);
  36. }
  37. if (type == typeof(UnlinkFromExistingCustomerServiceRequest))
  38. {
  39. return UnlinkFromExistingCustomer((UnlinkFromExistingCustomerServiceRequest)request);
  40. }
  41. if (type == typeof(GetCustomerBalanceServiceRequest))
  42. {
  43. return GetBalance((GetCustomerBalanceServiceRequest)request);
  44. }
  45. if (type == typeof(GetOrderHistoryServiceRequest))
  46. {
  47. return GetOrderHistory((GetOrderHistoryServiceRequest)request);
  48. }
  49. if (type == typeof(GetValidatedCustomerAccountNumberServiceRequest))
  50. {
  51. return ValidateCustomerAccountNumber((GetValidatedCustomerAccountNumberServiceRequest)request);
  52. }
  53. if (type == typeof(GetPurchaseHistoryServiceRequest))
  54. {
  55. return GetPurchaseHistory((GetPurchaseHistoryServiceRequest)request);
  56. }
  57. if (type == typeof(GetShipmentHistoryServiceRequest))
  58. {
  59. return GetOrderShipmentsHistory((GetShipmentHistoryServiceRequest)request);
  60. }
  61. throw new NotSupportedException($"Request '{request.GetType()}' is not supported.");
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement