IGrainFactory.GetGrain Method
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.
GetGrain(GrainId) |
Returns an untyped reference for the provided grain id. |
GetGrain(GrainId, GrainInterfaceType) |
Returns a reference for the provided grain id which implements the specified interface type. |
GetGrain(Type, Guid) |
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key. |
GetGrain(Type, Int64) |
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key. |
GetGrain(Type, String) |
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key. |
GetGrain(Type, Guid, String) |
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key. |
GetGrain(Type, Int64, String) |
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key. |
GetGrain<TGrainInterface>(Int64, String, String) |
Gets a reference to a grain. |
GetGrain<TGrainInterface>(Guid, String, String) |
Gets a reference to a grain. |
GetGrain<TGrainInterface>(Type, String) |
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface. The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters). |
GetGrain<TGrainInterface>(Type, Int64) |
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface. The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters). |
GetGrain<TGrainInterface>(GrainId) |
Returns a reference to the specified grain which implements the specified interface. |
GetGrain<TGrainInterface>(String, String) |
Gets a reference to a grain. |
GetGrain<TGrainInterface>(Int64, String) |
Gets a reference to a grain. |
GetGrain<TGrainInterface>(Guid, String) |
Gets a reference to a grain. |
GetGrain<TGrainInterface>(Type, Guid, String) |
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface. The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters). |
GetGrain<TGrainInterface>(Type, Guid) |
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface. The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters). |
GetGrain<TGrainInterface>(Type, Int64, String) |
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface. The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters). |
Returns an untyped reference for the provided grain id.
public Orleans.Runtime.IAddressable GetGrain (Orleans.Runtime.GrainId grainId);
abstract member GetGrain : Orleans.Runtime.GrainId -> Orleans.Runtime.IAddressable
Public Function GetGrain (grainId As GrainId) As IAddressable
Parameters
- grainId
- GrainId
The grain id.
Returns
An untyped reference for the provided grain id.
Applies to
Returns a reference for the provided grain id which implements the specified interface type.
public Orleans.Runtime.IAddressable GetGrain (Orleans.Runtime.GrainId grainId, Orleans.Runtime.GrainInterfaceType interfaceType);
abstract member GetGrain : Orleans.Runtime.GrainId * Orleans.Runtime.GrainInterfaceType -> Orleans.Runtime.IAddressable
Public Function GetGrain (grainId As GrainId, interfaceType As GrainInterfaceType) As IAddressable
Parameters
- grainId
- GrainId
The grain id.
- interfaceType
- GrainInterfaceType
The interface type which the returned grain reference must implement.
Returns
A reference for the provided grain id which implements the specified interface type.
Applies to
- Source:
- IGrainFactory.cs
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
public Orleans.IGrain GetGrain (Type grainInterfaceType, Guid grainPrimaryKey);
abstract member GetGrain : Type * Guid -> Orleans.IGrain
Public Function GetGrain (grainInterfaceType As Type, grainPrimaryKey As Guid) As IGrain
Parameters
- grainInterfaceType
- Type
The grain interface type which the returned grain reference must implement.
- grainPrimaryKey
- Guid
The primary key of the grain
Returns
A reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
Applies to
- Source:
- IGrainFactory.cs
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
public Orleans.IGrain GetGrain (Type grainInterfaceType, long grainPrimaryKey);
abstract member GetGrain : Type * int64 -> Orleans.IGrain
Public Function GetGrain (grainInterfaceType As Type, grainPrimaryKey As Long) As IGrain
Parameters
- grainInterfaceType
- Type
The grain interface type which the returned grain reference must implement.
- grainPrimaryKey
- Int64
The primary key of the grain
Returns
A reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
Applies to
- Source:
- IGrainFactory.cs
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
public Orleans.IGrain GetGrain (Type grainInterfaceType, string grainPrimaryKey);
abstract member GetGrain : Type * string -> Orleans.IGrain
Public Function GetGrain (grainInterfaceType As Type, grainPrimaryKey As String) As IGrain
Parameters
- grainInterfaceType
- Type
The grain interface type which the returned grain reference must implement.
- grainPrimaryKey
- String
The primary key of the grain
Returns
A reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
Applies to
- Source:
- IGrainFactory.cs
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
public Orleans.IGrain GetGrain (Type grainInterfaceType, Guid grainPrimaryKey, string keyExtension);
abstract member GetGrain : Type * Guid * string -> Orleans.IGrain
Public Function GetGrain (grainInterfaceType As Type, grainPrimaryKey As Guid, keyExtension As String) As IGrain
Parameters
- grainInterfaceType
- Type
The grain interface type which the returned grain reference must implement.
- grainPrimaryKey
- Guid
The primary key of the grain
- keyExtension
- String
The grain key extension component.
Returns
A reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
Applies to
- Source:
- IGrainFactory.cs
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
public Orleans.IGrain GetGrain (Type grainInterfaceType, long grainPrimaryKey, string keyExtension);
abstract member GetGrain : Type * int64 * string -> Orleans.IGrain
Public Function GetGrain (grainInterfaceType As Type, grainPrimaryKey As Long, keyExtension As String) As IGrain
Parameters
- grainInterfaceType
- Type
The grain interface type which the returned grain reference must implement.
- grainPrimaryKey
- Int64
The primary key of the grain
- keyExtension
- String
The grain key extension component.
Returns
A reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.
Applies to
- Source:
- IGrainFactory.cs
Gets a reference to a grain.
public TGrainInterface GetGrain<TGrainInterface> (long primaryKey, string keyExtension, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithIntegerCompoundKey;
abstract member GetGrain : int64 * string * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrainWithIntegerCompoundKey)
Public Function GetGrain(Of TGrainInterface As IGrainWithIntegerCompoundKey) (primaryKey As Long, keyExtension As String, Optional grainClassNamePrefix As String = Nothing) As TGrainInterface
Type Parameters
- TGrainInterface
The interface type.
Parameters
- primaryKey
- Int64
The primary key of the grain.
- keyExtension
- String
The key extension of the grain.
- grainClassNamePrefix
- String
An optional class name prefix used to find the runtime type of the grain.
Returns
A reference to the specified grain.
Applies to
- Source:
- IGrainFactory.cs
Gets a reference to a grain.
public TGrainInterface GetGrain<TGrainInterface> (Guid primaryKey, string keyExtension, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithGuidCompoundKey;
abstract member GetGrain : Guid * string * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrainWithGuidCompoundKey)
Public Function GetGrain(Of TGrainInterface As IGrainWithGuidCompoundKey) (primaryKey As Guid, keyExtension As String, Optional grainClassNamePrefix As String = Nothing) As TGrainInterface
Type Parameters
- TGrainInterface
The interface type.
Parameters
- primaryKey
- Guid
The primary key of the grain.
- keyExtension
- String
The key extension of the grain.
- grainClassNamePrefix
- String
An optional class name prefix used to find the runtime type of the grain.
Returns
A reference to the specified grain.
Applies to
- Source:
- IGrainFactory.cs
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface.
The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters).
public TGrainInterface GetGrain<TGrainInterface> (Type grainInterfaceType, string grainPrimaryKey) where TGrainInterface : Orleans.IGrain;
abstract member GetGrain : Type * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrain)
Public Function GetGrain(Of TGrainInterface As IGrain) (grainInterfaceType As Type, grainPrimaryKey As String) As TGrainInterface
Type Parameters
- TGrainInterface
The output type of the grain
Parameters
- grainInterfaceType
- Type
the runtime type of the grain interface
- grainPrimaryKey
- String
the primary key of the grain
Returns
the requested grain with the given grainID and grainInterfaceType
Applies to
- Source:
- IGrainFactory.cs
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface.
The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters).
public TGrainInterface GetGrain<TGrainInterface> (Type grainInterfaceType, long grainPrimaryKey) where TGrainInterface : Orleans.IGrain;
abstract member GetGrain : Type * int64 -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrain)
Public Function GetGrain(Of TGrainInterface As IGrain) (grainInterfaceType As Type, grainPrimaryKey As Long) As TGrainInterface
Type Parameters
- TGrainInterface
The output type of the grain
Parameters
- grainInterfaceType
- Type
the runtime type of the grain interface
- grainPrimaryKey
- Int64
the primary key of the grain
Returns
the requested grain with the given grainID and grainInterfaceType
Applies to
Returns a reference to the specified grain which implements the specified interface.
public TGrainInterface GetGrain<TGrainInterface> (Orleans.Runtime.GrainId grainId) where TGrainInterface : Orleans.Runtime.IAddressable;
abstract member GetGrain : Orleans.Runtime.GrainId -> 'GrainInterface (requires 'GrainInterface :> Orleans.Runtime.IAddressable)
Public Function GetGrain(Of TGrainInterface As IAddressable) (grainId As GrainId) As TGrainInterface
Type Parameters
- TGrainInterface
The grain interface type which the returned grain reference must implement.
Parameters
- grainId
- GrainId
The grain id.
Returns
A reference to the specified grain which implements the specified interface.
Applies to
- Source:
- IGrainFactory.cs
Gets a reference to a grain.
public TGrainInterface GetGrain<TGrainInterface> (string primaryKey, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithStringKey;
abstract member GetGrain : string * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrainWithStringKey)
Public Function GetGrain(Of TGrainInterface As IGrainWithStringKey) (primaryKey As String, Optional grainClassNamePrefix As String = Nothing) As TGrainInterface
Type Parameters
- TGrainInterface
The interface type.
Parameters
- primaryKey
- String
The primary key of the grain.
- grainClassNamePrefix
- String
An optional class name prefix used to find the runtime type of the grain.
Returns
A reference to the specified grain.
Applies to
- Source:
- IGrainFactory.cs
Gets a reference to a grain.
public TGrainInterface GetGrain<TGrainInterface> (long primaryKey, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithIntegerKey;
abstract member GetGrain : int64 * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrainWithIntegerKey)
Public Function GetGrain(Of TGrainInterface As IGrainWithIntegerKey) (primaryKey As Long, Optional grainClassNamePrefix As String = Nothing) As TGrainInterface
Type Parameters
- TGrainInterface
The interface type.
Parameters
- primaryKey
- Int64
The primary key of the grain.
- grainClassNamePrefix
- String
An optional class name prefix used to find the runtime type of the grain.
Returns
A reference to the specified grain.
Applies to
- Source:
- IGrainFactory.cs
Gets a reference to a grain.
public TGrainInterface GetGrain<TGrainInterface> (Guid primaryKey, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithGuidKey;
abstract member GetGrain : Guid * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrainWithGuidKey)
Public Function GetGrain(Of TGrainInterface As IGrainWithGuidKey) (primaryKey As Guid, Optional grainClassNamePrefix As String = Nothing) As TGrainInterface
Type Parameters
- TGrainInterface
The interface type.
Parameters
- primaryKey
- Guid
The primary key of the grain.
- grainClassNamePrefix
- String
An optional class name prefix used to find the runtime type of the grain.
Returns
A reference to the specified grain.
Applies to
- Source:
- IGrainFactory.cs
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface.
The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters).
public TGrainInterface GetGrain<TGrainInterface> (Type grainInterfaceType, Guid grainPrimaryKey, string keyExtension) where TGrainInterface : Orleans.IGrain;
abstract member GetGrain : Type * Guid * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrain)
Public Function GetGrain(Of TGrainInterface As IGrain) (grainInterfaceType As Type, grainPrimaryKey As Guid, keyExtension As String) As TGrainInterface
Type Parameters
- TGrainInterface
The output type of the grain
Parameters
- grainInterfaceType
- Type
the runtime type of the grain interface
- grainPrimaryKey
- Guid
the primary key of the grain
- keyExtension
- String
The key extension of the grain.
Returns
the requested grain with the given grainID and grainInterfaceType
Applies to
- Source:
- IGrainFactory.cs
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface.
The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters).
public TGrainInterface GetGrain<TGrainInterface> (Type grainInterfaceType, Guid grainPrimaryKey) where TGrainInterface : Orleans.IGrain;
abstract member GetGrain : Type * Guid -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrain)
Public Function GetGrain(Of TGrainInterface As IGrain) (grainInterfaceType As Type, grainPrimaryKey As Guid) As TGrainInterface
Type Parameters
- TGrainInterface
The output type of the grain
Parameters
- grainInterfaceType
- Type
the runtime type of the grain interface
- grainPrimaryKey
- Guid
the primary key of the grain
Returns
the requested grain with the given grainID and grainInterfaceType
Applies to
- Source:
- IGrainFactory.cs
A GetGrain overload that returns the runtime type of the grain interface and returns the grain cast to TGrainInterface.
The main use-case is when you want to get a grain whose type is unknown at compile time (e.g. generic type parameters).
public TGrainInterface GetGrain<TGrainInterface> (Type grainInterfaceType, long grainPrimaryKey, string keyExtension) where TGrainInterface : Orleans.IGrain;
abstract member GetGrain : Type * int64 * string -> 'GrainInterface (requires 'GrainInterface :> Orleans.IGrain)
Public Function GetGrain(Of TGrainInterface As IGrain) (grainInterfaceType As Type, grainPrimaryKey As Long, keyExtension As String) As TGrainInterface
Type Parameters
- TGrainInterface
The output type of the grain
Parameters
- grainInterfaceType
- Type
the runtime type of the grain interface
- grainPrimaryKey
- Int64
the primary key of the grain
- keyExtension
- String
The key extension of the grain.
Returns
the requested grain with the given grainID and grainInterfaceType