Class ProtobufServiceProviderExtensions
- Namespace
- IceRpc.Extensions.DependencyInjection
- Assembly
- IceRpc.Protobuf.dll
Provides extension methods for IServiceProvider to create Protobuf clients.
public static class ProtobufServiceProviderExtensions
- Inheritance
-
ProtobufServiceProviderExtensions
- Inherited Members
Methods
CreateProtobufClient<TClient>(IServiceProvider, ServiceAddress?)
Creates a Protobuf client with this service provider.
public static TClient CreateProtobufClient<TClient>(this IServiceProvider provider, ServiceAddress? serviceAddress = null) where TClient : struct, IProtobufClient
Parameters
providerIServiceProviderThe service provider.
serviceAddressServiceAddressThe service address of the new client; null is equivalent to the default service address for the client type.
Returns
- TClient
A new instance of
TClient.
Type Parameters
TClientThe Protobuf client struct.
Remarks
The new client uses the IInvoker retrieved from provider as its
invocation pipeline, and the ProtobufEncodeOptions retrieved from provider as
its encode options.
CreateProtobufClient<TClient>(IServiceProvider, Uri)
Creates a Protobuf client with this service provider.
public static TClient CreateProtobufClient<TClient>(this IServiceProvider provider, Uri serviceAddressUri) where TClient : struct, IProtobufClient
Parameters
providerIServiceProviderThe service provider.
serviceAddressUriUriThe service address of the client as a URI.
Returns
- TClient
A new instance of
TClient.
Type Parameters
TClientThe Protobuf client struct.
Remarks
The new client uses the IInvoker retrieved from provider as its
invocation pipeline, and the ProtobufEncodeOptions retrieved from provider as
its encode options.