Class ServiceInterface<T>
- Namespace
- Nerdbank.JsonRpc.BrokeredServices
- Assembly
- Nerdbank.JsonRpc.dll
Captures an optional or callback contract without erasing its interface type.
public sealed class ServiceInterface<T> : ServiceInterface where T : class
Type Parameters
TThe captured contract.
- Inheritance
-
ServiceInterface<T>
- Inherited Members
Methods
AddRpcTarget(JsonRpc, T, JsonRpcTargetOptions)
Registers the typed contract implementation.
public void AddRpcTarget(JsonRpc rpc, T target, JsonRpcTargetOptions options)
Parameters
rpcJsonRpcThe connection.
targetTThe contract implementation.
optionsJsonRpcTargetOptionsTarget registration options.
AddRpcTargetCore(JsonRpc, object, JsonRpcTargetOptions)
Registers the captured contract after its type has been erased.
protected override void AddRpcTargetCore(JsonRpc rpc, object target, JsonRpcTargetOptions options)
Parameters
rpcJsonRpcThe connection.
targetobjectThe implementation.
optionsJsonRpcTargetOptionsTarget registration options.
CreateLocalProxy(ServiceProxyContext)
Constructs a typed direct proxy for this captured contract.
public T CreateLocalProxy(ServiceProxyContext context)
Parameters
contextServiceProxyContextThe target and callback lifetime.
Returns
- T
The generated proxy.
CreateLocalProxyCore(ServiceProxyContext)
Constructs a direct proxy after the captured contract type has been erased.
protected override object CreateLocalProxyCore(ServiceProxyContext context)
Parameters
contextServiceProxyContextThe target and callback lifetime.
Returns
- object
The generated proxy.
CreateProxy(JsonRpc, JsonRpcProxyOptions?)
Constructs a typed proxy for this captured contract.
public T CreateProxy(JsonRpc rpc, JsonRpcProxyOptions? options = null)
Parameters
rpcJsonRpcThe unstarted connection.
optionsJsonRpcProxyOptionsProxy naming and argument conventions.
Returns
- T
The generated proxy. The connection remains caller-owned.
CreateProxyCore(JsonRpc, JsonRpcProxyOptions?)
Constructs a proxy after the captured contract type has been erased.
protected override object CreateProxyCore(JsonRpc rpc, JsonRpcProxyOptions? options)
Parameters
rpcJsonRpcThe unstarted connection.
optionsJsonRpcProxyOptionsProxy naming and argument conventions.
Returns
- object
The generated proxy.