Düzenle

Aracılığıyla paylaş


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.

public static object Cast (this Orleans.Runtime.IAddressable grain, Type interfaceType);
static member Cast : Orleans.Runtime.IAddressable * Type -> obj
<Extension()>
Public Function Cast (grain As IAddressable, interfaceType As Type) As Object

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

Cast<TGrainInterface>(IAddressable)

Source:
GrainExtensions.cs

Returns a typed reference to the provided grain.

public static TGrainInterface Cast<TGrainInterface> (this Orleans.Runtime.IAddressable grain);
static member Cast : Orleans.Runtime.IAddressable -> 'GrainInterface
<Extension()>
Public Function Cast(Of TGrainInterface) (grain As IAddressable) As TGrainInterface

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