Table of Contents

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

provider IServiceProvider

The service provider.

serviceAddress ServiceAddress

The 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

TClient

The 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

provider IServiceProvider

The service provider.

serviceAddressUri Uri

The service address of the client as a URI.

Returns

TClient

A new instance of TClient.

Type Parameters

TClient

The 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.