Show / Hide Table of Contents

Class GrainExtensions

Extension methods for grains.

Inheritance
System.Object
GrainExtensions
Namespace: Orleans
Assembly: Orleans.Core.Abstractions.dll
Syntax
public static class GrainExtensions : object

Methods

| Improve this Doc View Source

AsReference<TGrainInterface>(IAddressable)

Converts this grain to a specific grain interface.

Declaration
public static TGrainInterface AsReference<TGrainInterface>(this IAddressable grain)
Parameters
Type Name Description
IAddressable grain

The grain to convert.

Returns
Type Description
TGrainInterface

A strongly typed GrainReference of grain interface type TGrainInterface.

Type Parameters
Name Description
TGrainInterface

The type of the grain interface.

| Improve this Doc View Source

BindGrainReference(IAddressable, IGrainFactory)

Binds the grain reference to the provided IGrainFactory.

Declaration
public static void BindGrainReference(this IAddressable grain, IGrainFactory grainFactory)
Parameters
Type Name Description
IAddressable grain

The grain reference.

IGrainFactory grainFactory

The grain factory.

| Improve this Doc View Source

Cast<TGrainInterface>(IAddressable)

Casts a grain to a specific grain interface.

Declaration
public static TGrainInterface Cast<TGrainInterface>(this IAddressable grain)
Parameters
Type Name Description
IAddressable grain

The grain to cast.

Returns
Type Description
TGrainInterface
Type Parameters
Name Description
TGrainInterface

The type of the grain interface.

| Improve this Doc View Source

GetGrainIdentity(IGrain)

Declaration
public static IGrainIdentity GetGrainIdentity(this IGrain grain)
Parameters
Type Name Description
IGrain grain
Returns
Type Description
IGrainIdentity
| Improve this Doc View Source

GetPrimaryKey(IGrain)

Declaration
public static Guid GetPrimaryKey(this IGrain grain)
Parameters
Type Name Description
IGrain grain
Returns
Type Description
Guid
| Improve this Doc View Source

GetPrimaryKey(IGrain, out String)

Declaration
public static Guid GetPrimaryKey(this IGrain grain, out string keyExt)
Parameters
Type Name Description
IGrain grain
System.String keyExt
Returns
Type Description
Guid
| Improve this Doc View Source

GetPrimaryKey(IAddressable)

Returns the Guid representation of a grain primary key.

Declaration
public static Guid GetPrimaryKey(this IAddressable grain)
Parameters
Type Name Description
IAddressable grain

The grain to find the primary key for.

Returns
Type Description
Guid

A Guid representing the primary key for this grain.

| Improve this Doc View Source

GetPrimaryKey(IAddressable, out String)

Returns the Guid representation of a grain primary key.

Declaration
public static Guid GetPrimaryKey(this IAddressable grain, out string keyExt)
Parameters
Type Name Description
IAddressable grain

The grain to find the primary key for.

System.String keyExt

The output paramater to return the extended key part of the grain primary key, if extened primary key was provided for that grain.

Returns
Type Description
Guid

A Guid representing the primary key for this grain.

| Improve this Doc View Source

GetPrimaryKeyLong(IGrain)

Declaration
public static long GetPrimaryKeyLong(this IGrain grain)
Parameters
Type Name Description
IGrain grain
Returns
Type Description
System.Int64
| Improve this Doc View Source

GetPrimaryKeyLong(IGrain, out String)

Declaration
public static long GetPrimaryKeyLong(this IGrain grain, out string keyExt)
Parameters
Type Name Description
IGrain grain
System.String keyExt
Returns
Type Description
System.Int64
| Improve this Doc View Source

GetPrimaryKeyLong(IAddressable)

Returns the long representation of a grain primary key.

Declaration
public static long GetPrimaryKeyLong(this IAddressable grain)
Parameters
Type Name Description
IAddressable grain

The grain to find the primary key for.

Returns
Type Description
System.Int64

A long representing the primary key for this grain.

| Improve this Doc View Source

GetPrimaryKeyLong(IAddressable, out String)

Returns the long representation of a grain primary key.

Declaration
public static long GetPrimaryKeyLong(this IAddressable grain, out string keyExt)
Parameters
Type Name Description
IAddressable grain

The grain to find the primary key for.

System.String keyExt

The output paramater to return the extended key part of the grain primary key, if extened primary key was provided for that grain.

Returns
Type Description
System.Int64

A long representing the primary key for this grain.

| Improve this Doc View Source

GetPrimaryKeyString(IGrainWithStringKey)

Declaration
public static string GetPrimaryKeyString(this IGrainWithStringKey grain)
Parameters
Type Name Description
IGrainWithStringKey grain
Returns
Type Description
System.String
| Improve this Doc View Source

GetPrimaryKeyString(IAddressable)

Returns the string primary key of the grain.

Declaration
public static string GetPrimaryKeyString(this IAddressable grain)
Parameters
Type Name Description
IAddressable grain

The grain to find the primary key for.

Returns
Type Description
System.String

A string representing the primary key for this grain.

| Improve this Doc View Source

InvokeOneWay<T>(T, Func<T, Task>)

Invokes a method of a grain interface is one-way fashion so that no response message will be sent to the caller.

Declaration
public static void InvokeOneWay<T>(this T grainReference, Func<T, Task> grainMethodInvocation)where T : class, IAddressable
Parameters
Type Name Description
T grainReference

Grain reference which will be copied and then a call executed on it

Func<T, Task> grainMethodInvocation

Function that should invoke grain method and return resulting task

Type Parameters
Name Description
T

Grain interface

| Improve this Doc View Source

IsPrimaryKeyBasedOnLong(IAddressable)

Returns whether part of the primary key is of type long.

Declaration
public static bool IsPrimaryKeyBasedOnLong(this IAddressable grain)
Parameters
Type Name Description
IAddressable grain

The target grain.

Returns
Type Description
System.Boolean
  • Improve this Doc
  • View Source
Back to top Generated by DocFX