Table of Contents

Class IceProxyExtensions

Namespace
IceRpc.Ice
Assembly
IceRpc.Ice.dll

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

proxy IIceProxy

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.

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

proxy IIceProxy

The source proxy.

Returns

TProxy

A new instance of TProxy.

Type Parameters

TProxy

The type of the target proxy struct.