I've got a base class called Request.cs
In this class I have the following private fields:
protected string _requestURI = xxpConfig.xxEndpoint;
protected string _requestURIAuthBased = xxConfig.xxEndpoint + "?SessionID=";
endpoint is just a string such as "http://SomeThridPartyAPIURIEndPoint"
In this class I have a method called SendRequest.
Subclasses for example represent certain API calls:
UpdateCustomerRequest.cs (inherits Request.cs) DeleteCustomerRequest.cs (inherits Request.cs)
and so on.
the Request class has a method called SendRequest that takes the URI and does the work to send the API request.
Certain kinds of API calls require a sessionID to be passed and others don't. The only difference in the URI is an added param called sessionID.
So I'm trying to figure out the best and most efficient way to set the "flag" for each type of API call (subclass) as each may or may not require the auth formatted URI vs. the regular. So in my base class I could check whether I need to use the _requestURI vs. _requestURIAuthBased in my Request.SendMethod for the subclass that I'm going to be calling to make that API call.