Skip to content

GrainFactoryExtensions Methods

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

GetGrain(IGrainFactory, IdSpan)

staticextension
View source
public static TGrainInterface GetGrain<TGrainInterface>(this IGrainFactory grainFactory, IdSpan grainPrimaryKey)
Returns a reference for the provided grain id which implements the specified interface type.

Parameters

grainFactoryIGrainFactory
The grain factory.
grainPrimaryKeyIdSpan
The primary key of the grain

Returns

A reference for the provided grain id which implements the specified interface type.

GetGrain(IGrainFactory, IdSpan, string)

staticextension
View source
public static TGrainInterface GetGrain<TGrainInterface>(this IGrainFactory grainFactory, IdSpan grainPrimaryKey, string grainClassNamePrefix)
Returns a reference for the provided grain id which implements the specified interface type.

Parameters

grainFactoryIGrainFactory
The grain factory.
grainPrimaryKeyIdSpan
The primary key of the grain
grainClassNamePrefixstring
An optional class name prefix used to find the runtime type of the grain.

Returns

A reference for the provided grain id which implements the specified interface type.