Skip to content

AdoNetGrainStorage Methods

Stores grain state in a relational database using ADO.NET.

ClearStateAsync(string, GrainId, IGrainState<T>, CancellationToken)

View source
public Task ClearStateAsync<T>(string grainType, GrainId grainReference, IGrainState<T> grainState, CancellationToken cancellationToken)
Delete / Clear data function for this storage instance.

Parameters

grainTypestring
Name of the state for this grain.
grainReferenceGrainId
Grain ID.
grainStateIGrainState<T>
Copy of last-known state data object for this grain.
cancellationTokenCancellationToken
The cancellation token.

Returns

Completion promise for the Delete operation on the specified grain.

Participate(ISiloLifecycle)

View source
public void Participate(ISiloLifecycle lifecycle)
Registers the provider's initialization and shutdown callbacks with the silo lifecycle.

Parameters

lifecycleISiloLifecycle
The silo lifecycle.

ReadStateAsync(string, GrainId, IGrainState<T>, CancellationToken)

View source
public Task ReadStateAsync<T>(string grainType, GrainId grainReference, IGrainState<T> grainState, CancellationToken cancellationToken)
Read data function for this storage instance.

Parameters

grainTypestring
Name of the state for this grain.
grainReferenceGrainId
Grain ID.
grainStateIGrainState<T>
State data object to be populated for this grain.
cancellationTokenCancellationToken
The cancellation token.

Returns

Completion promise for the Read operation on the specified grain.

WriteStateAsync(string, GrainId, IGrainState<T>, CancellationToken)

View source
public Task WriteStateAsync<T>(string grainType, GrainId grainReference, IGrainState<T> grainState, CancellationToken cancellationToken)
Write data function for this storage instance.

Parameters

grainTypestring
Name of the state for this grain.
grainReferenceGrainId
Grain ID.
grainStateIGrainState<T>
State data object to be written for this grain.
cancellationTokenCancellationToken
The cancellation token.

Returns

Completion promise for the Write operation on the specified grain.