Class ProxyExtensions
Provides an extension method for interface IProxy.
public static class ProxyExtensions
- Inheritance
-
ProxyExtensions
- Inherited Members
Methods
AsAsync<TProxy>(IProxy, IFeatureCollection?, CancellationToken)
Tests whether the target service implements the Slice 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 Slice interface Ice::Object explicitly.
public static Task<TProxy?> AsAsync<TProxy>(this IProxy proxy, IFeatureCollection? features = null, CancellationToken cancellationToken = default) where TProxy : struct, IProxy
Parameters
proxyIProxyThe 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.