GrainExtensions.Cast Method

Definition

Overloads

Cast(IAddressable, Type)

Returns a typed reference to the provided grain.

Cast<TGrainInterface>(IAddressable)

Returns a typed reference to the provided grain.

Cast(IAddressable, Type)

Source:
GrainExtensions.cs

Returns a typed reference to the provided grain.

C#
public static object Cast(this Orleans.Runtime.IAddressable grain, Type interfaceType);

Parameters

grain
IAddressable

The grain to convert.

interfaceType
Type

The type of the grain interface.

Returns

A strongly typed reference to the provided grain which implements interfaceType.

Remarks

This method is equivalent to AsReference(IAddressable, Type). If the provided value is a grain instance, this will create a reference which implements the provided interface. If the provided value is already grain reference, this will create a new reference which implements the provided interface.

Applies to

.NET Orleans 9.0.0 a další verze
Produkt Verze
.NET Orleans 3.6.0, 7.0.0, 8.0.0, 8.1.0, 8.2.0, 9.0.0

Cast<TGrainInterface>(IAddressable)

Source:
GrainExtensions.cs

Returns a typed reference to the provided grain.

C#
public static TGrainInterface Cast<TGrainInterface>(this Orleans.Runtime.IAddressable grain);

Type Parameters

TGrainInterface

The type of the grain interface.

Parameters

grain
IAddressable

The grain to convert.

Returns

TGrainInterface

A strongly typed reference to the provided grain which implements TGrainInterface.

Remarks

This method is equivalent to AsReference<TGrainInterface>(IAddressable). If the provided value is a grain instance, this will create a reference which implements the provided interface. If the provided value is already grain reference, this will create a new reference which implements the provided interface.

Applies to

.NET Orleans 9.0.0 a další verze
Produkt Verze
.NET Orleans 1.5.10, 3.4.5, 3.6.0, 7.0.0, 8.0.0, 8.1.0, 8.2.0, 9.0.0