IGrainFactory.GetGrain Method

Definition

Overloads

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).

GetGrain(GrainId)

Returns an untyped reference for the provided grain id.

public Orleans.Runtime.IAddressable GetGrain (Orleans.Runtime.GrainId grainId);

Parameters

grainId
GrainId

The grain id.

Returns

An untyped reference for the provided grain id.

Applies to

GetGrain(GrainId, GrainInterfaceType)

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);

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

GetGrain(Type, Guid)

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);

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

GetGrain(Type, Int64)

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);

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

GetGrain(Type, String)

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);

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

GetGrain(Type, Guid, String)

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);

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

GetGrain(Type, Int64, String)

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);

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

GetGrain<TGrainInterface>(Int64, String, String)

Source:
IGrainFactory.cs

Gets a reference to a grain.

public TGrainInterface GetGrain<TGrainInterface> (long primaryKey, string keyExtension, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithIntegerCompoundKey;

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

TGrainInterface

A reference to the specified grain.

Applies to

GetGrain<TGrainInterface>(Guid, String, String)

Source:
IGrainFactory.cs

Gets a reference to a grain.

public TGrainInterface GetGrain<TGrainInterface> (Guid primaryKey, string keyExtension, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithGuidCompoundKey;

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

TGrainInterface

A reference to the specified grain.

Applies to

GetGrain<TGrainInterface>(Type, String)

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;

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

TGrainInterface

the requested grain with the given grainID and grainInterfaceType

Applies to

GetGrain<TGrainInterface>(Type, Int64)

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;

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

TGrainInterface

the requested grain with the given grainID and grainInterfaceType

Applies to

GetGrain<TGrainInterface>(GrainId)

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;

Type Parameters

TGrainInterface

The grain interface type which the returned grain reference must implement.

Parameters

grainId
GrainId

The grain id.

Returns

TGrainInterface

A reference to the specified grain which implements the specified interface.

Applies to

GetGrain<TGrainInterface>(String, String)

Source:
IGrainFactory.cs

Gets a reference to a grain.

public TGrainInterface GetGrain<TGrainInterface> (string primaryKey, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithStringKey;

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

TGrainInterface

A reference to the specified grain.

Applies to

GetGrain<TGrainInterface>(Int64, String)

Source:
IGrainFactory.cs

Gets a reference to a grain.

public TGrainInterface GetGrain<TGrainInterface> (long primaryKey, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithIntegerKey;

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

TGrainInterface

A reference to the specified grain.

Applies to

GetGrain<TGrainInterface>(Guid, String)

Source:
IGrainFactory.cs

Gets a reference to a grain.

public TGrainInterface GetGrain<TGrainInterface> (Guid primaryKey, string grainClassNamePrefix = default) where TGrainInterface : Orleans.IGrainWithGuidKey;

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

TGrainInterface

A reference to the specified grain.

Applies to

GetGrain<TGrainInterface>(Type, Guid, String)

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;

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

TGrainInterface

the requested grain with the given grainID and grainInterfaceType

Applies to

GetGrain<TGrainInterface>(Type, Guid)

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;

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

TGrainInterface

the requested grain with the given grainID and grainInterfaceType

Applies to

GetGrain<TGrainInterface>(Type, Int64, String)

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;

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

TGrainInterface

the requested grain with the given grainID and grainInterfaceType

Applies to