GrainExtensions.Cast Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.