Table of Contents

Class ProxyExtensions

Namespace
IceRpc.Slice.Ice
Assembly
IceRpc.Slice.dll

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

proxy IProxy

The source proxy being tested.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<TProxy?>

A new TProxy instance when IceIsAAsync(string, IFeatureCollection?, CancellationToken) returns true; otherwise, null.

Type Parameters

TProxy

The type of the target proxy struct.

Remarks

This method is equivalent to the "checked cast" methods provided by Ice.