Class MyServerInvoker
A web DataStore used for JavaScript clients communicating through to a DataStore.
public class MyServerInvoker : WebServerInvoker, IWebServerInvoker
  - Inheritance
 - 
      
      
      MyServerInvoker
 
- Implements
 
- Derived
 
- Inherited Members
 
Remarks
The maximum number of concurrent connections per server is 64, provided by the default HttpMessageHandler. It can be increased/decreased by providing a custom instance of HttpMessageHandler.
Constructors
MyServerInvoker(string, int?, string?, HttpMessageHandler?, ApiClientConfiguration?)
Initializes a new instance of the MyServerInvoker class.
public MyServerInvoker(string url, int? timeout = null, string? servicePath = null, HttpMessageHandler? handler = null, ApiClientConfiguration? apiClientConfiguration = null)
  Parameters
urlstringThe URL.
timeoutint?The request timeout in milliseconds. (Default 300000 and this is the maximum).
servicePathstringPath to web service. [Default "apiv1"].
handlerHttpMessageHandlerThe HttpMessageHandler for overriding of the default shared httpClient (max connection pool size 64).
apiClientConfigurationApiClientConfigurationThe ApiClientConfiguration provided by the API client for custom configurations.
Methods
CheckForError(string, Exception?, JsonRpcErrorCode?, JsonRpcErrorData?)
Check JSON error.
protected override Exception? CheckForError(string message, Exception? innerException, JsonRpcErrorCode? errorCode, JsonRpcErrorData? errorData)
  Parameters
messagestringThe error message.
innerExceptionExceptionThe inner exception.
errorCodeJsonRpcErrorCode?The JsonRpcErrorCode for JSON-RPC error type that occurred.
errorDataJsonRpcErrorDataPrimitive or Structured value that contains additional information about the error.
Returns
- Exception
 The Exception object.
OnDerivableErrorCode(string, Exception?, JsonRpcErrorCode?, JsonRpcErrorData)
Let other derived invokers handle their own exception types.
protected virtual Exception? OnDerivableErrorCode(string message, Exception? innerException, JsonRpcErrorCode? errorCode, JsonRpcErrorData errorData)
  Parameters
messagestringThe exception message.
innerExceptionExceptionThe inner exception.
errorCodeJsonRpcErrorCode?The error code.
errorDataJsonRpcErrorDataThe error data.
Returns
- Exception
 The delineated exception, or base implementation.
Remarks
This could further be broken down into the derived invoker classes. Kept the core logic here.
ToJson(object)
Convert object to JSON string.
protected override string ToJson(object obj)
  Parameters
objobjectThe object to be converted.
Returns
- string
 The JSON string result.
ToJsonContent(object)
Gets JsonContent wrapped serialization target.
protected override JsonContent ToJsonContent(object serializationTarget)
  Parameters
serializationTargetobjectThe object for seralization.