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