Skip to content

IGrainFactory Methods

Functionality for creating references to grains.

CreateObjectReference(IGrainObserver)

abstract
public abstract TGrainObserverInterface CreateObjectReference<TGrainObserverInterface>(IGrainObserver obj)
Creates a reference to the provided obj.

Parameters

objIGrainObserver
The object to create a reference to.

Returns

The reference to obj.

DeleteObjectReference(IGrainObserver)

abstract
public abstract void DeleteObjectReference<TGrainObserverInterface>(IGrainObserver obj)
Deletes the provided object reference.

Parameters

objIGrainObserver
The reference being deleted.

Returns

A System.Threading.Tasks.Task representing the work performed.

GetGrain(GrainId)

abstract
public abstract IAddressable GetGrain(GrainId grainId)
Returns an untyped reference for the provided grain id.

Parameters

grainIdGrainId
The grain id.

Returns

An untyped reference for the provided grain id.

GetGrain(GrainId, GrainInterfaceType)

abstract
public abstract IAddressable GetGrain(GrainId grainId, GrainInterfaceType interfaceType)
Returns a reference for the provided grain id which implements the specified interface type.

Parameters

grainIdGrainId
The grain id.
interfaceTypeGrainInterfaceType
The interface type which the returned grain reference must implement.

Returns

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

GetGrain(Type, IdSpan)

abstract
public abstract IAddressable GetGrain(Type interfaceType, IdSpan grainKey)
Returns a reference for the provided grain id which implements the specified interface type.

Parameters

interfaceTypeType
The grain interface type which the returned grain reference must implement.
grainKeyIdSpan
The primary key of the grain

Returns

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

GetGrain(Type, IdSpan, string)

abstract
public abstract IAddressable GetGrain(Type interfaceType, IdSpan grainKey, string grainClassNamePrefix)
Returns a reference for the provided grain id which implements the specified interface type.

Parameters

interfaceTypeType
The grain interface type which the returned grain reference must implement.
grainKeyIdSpan
The primary key of the grain
grainClassNamePrefixstring
A 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.

GetGrain(Type, Guid)

abstract
public abstract IGrain GetGrain(Type grainInterfaceType, Guid grainPrimaryKey)
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.

Parameters

grainInterfaceTypeType
The grain interface type which the returned grain reference must implement.
grainPrimaryKeyGuid
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.

GetGrain(Type, Guid, string)

abstract
public abstract IGrain GetGrain(Type grainInterfaceType, Guid grainPrimaryKey, string keyExtension)
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.

Parameters

grainInterfaceTypeType
The grain interface type which the returned grain reference must implement.
grainPrimaryKeyGuid
The primary key of the grain
keyExtensionstring
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.

GetGrain(Type, long)

abstract
public abstract IGrain GetGrain(Type grainInterfaceType, long grainPrimaryKey)
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.

Parameters

grainInterfaceTypeType
The grain interface type which the returned grain reference must implement.
grainPrimaryKeylong
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.

GetGrain(Type, long, string)

abstract
public abstract IGrain GetGrain(Type grainInterfaceType, long grainPrimaryKey, string keyExtension)
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.

Parameters

grainInterfaceTypeType
The grain interface type which the returned grain reference must implement.
grainPrimaryKeylong
The primary key of the grain
keyExtensionstring
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.

GetGrain(Type, string)

abstract
public abstract IGrain GetGrain(Type grainInterfaceType, string grainPrimaryKey)
Returns a reference to the grain which is the primary implementation of the provided interface type and has the provided primary key.

Parameters

grainInterfaceTypeType
The grain interface type which the returned grain reference must implement.
grainPrimaryKeystring
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.

GetGrain(GrainId)

abstract
public abstract TGrainInterface GetGrain<TGrainInterface>(GrainId grainId)
Returns a reference to the specified grain which implements the specified interface.

Parameters

grainIdGrainId
The grain id.

Returns

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

GetGrain(Guid, string, string?)

abstract
public abstract TGrainInterface GetGrain<TGrainInterface>(Guid primaryKey, string keyExtension, string? grainClassNamePrefix = null)
Gets a reference to a grain.

Parameters

primaryKeyGuid
The primary key of the grain.
keyExtensionstring
The key extension of the grain.
grainClassNamePrefixstring?
An optional class name prefix used to find the runtime type of the grain.

Returns

A reference to the specified grain.

GetGrain(Guid, string?)

abstract
public abstract TGrainInterface GetGrain<TGrainInterface>(Guid primaryKey, string? grainClassNamePrefix = null)
Gets a reference to a grain.

Parameters

primaryKeyGuid
The primary key of the grain.
grainClassNamePrefixstring?
An optional class name prefix used to find the runtime type of the grain.

Returns

A reference to the specified grain.

GetGrain(long, string, string?)

abstract
public abstract TGrainInterface GetGrain<TGrainInterface>(long primaryKey, string keyExtension, string? grainClassNamePrefix = null)
Gets a reference to a grain.

Parameters

primaryKeylong
The primary key of the grain.
keyExtensionstring
The key extension of the grain.
grainClassNamePrefixstring?
An optional class name prefix used to find the runtime type of the grain.

Returns

A reference to the specified grain.

GetGrain(long, string?)

abstract
public abstract TGrainInterface GetGrain<TGrainInterface>(long primaryKey, string? grainClassNamePrefix = null)
Gets a reference to a grain.

Parameters

primaryKeylong
The primary key of the grain.
grainClassNamePrefixstring?
An optional class name prefix used to find the runtime type of the grain.

Returns

A reference to the specified grain.

GetGrain(string, string?)

abstract
public abstract TGrainInterface GetGrain<TGrainInterface>(string primaryKey, string? grainClassNamePrefix = null)
Gets a reference to a grain.

Parameters

primaryKeystring
The primary key of the grain.
grainClassNamePrefixstring?
An optional class name prefix used to find the runtime type of the grain.

Returns

A reference to the specified grain.