Class IceProxyExtensions
Provides extension methods for IIceProxy and generated proxy structs that implement this interface.
public static class IceProxyExtensions
- Inheritance
-
IceProxyExtensions
- Inherited Members
Methods
AsAsync<TProxy>(IIceProxy, IFeatureCollection?, CancellationToken)
Tests whether the target service implements the Ice interface associated with
TProxy. This method is a wrapper for IceIsAAsync(string, IFeatureCollection?, CancellationToken).
All services implemented with Ice automatically provide this operation. Services implemented with IceRPC provide
this operation only when they implement Ice interface Ice::Object explicitly.
public static Task<TProxy?> AsAsync<TProxy>(this IIceProxy proxy, IFeatureCollection? features = null, CancellationToken cancellationToken = default) where TProxy : struct, IIceProxy
Parameters
proxyIIceProxyThe source proxy being tested.
featuresIFeatureCollectionThe invocation features.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task<TProxy?>
A new
TProxyinstance when IceIsAAsync(string, IFeatureCollection?, CancellationToken) returns true; otherwise, null.
Type Parameters
TProxyThe type of the target proxy struct.
Remarks
This method is equivalent to the "checked cast" methods provided by Ice.
ToProxy<TProxy>(IIceProxy)
Converts a proxy into a proxy struct. This conversion always succeeds.
public static TProxy ToProxy<TProxy>(this IIceProxy proxy) where TProxy : struct, IIceProxy
Parameters
proxyIIceProxyThe source proxy.
Returns
- TProxy
A new instance of
TProxy.
Type Parameters
TProxyThe type of the target proxy struct.