Edytuj

Udostępnij za pośrednictwem


Grain<TGrainState> Constructors

Definition

Overloads

Grain<TGrainState>()

Initializes a new instance of the Grain<TGrainState> class.

Grain<TGrainState>(IStorage<TGrainState>)

Initializes a new instance of the Grain<TGrainState> class.

Grain<TGrainState>(IGrainIdentity, IGrainRuntime, IStorage<TGrainState>)

Grain implementers do NOT have to expose this constructor but can choose to do so. This constructor is particularly useful for unit testing where test code can create a Grain and replace the IGrainIdentity, IGrainRuntime and State with test doubles (mocks/stubs).

Grain<TGrainState>(IGrainIdentity, IGrainRuntime, TGrainState, IStorage)

Grain implementers do NOT have to expose this constructor but can choose to do so. This constructor is particularly useful for unit testing where test code can create a Grain and replace the IGrainIdentity, IGrainRuntime and State with test doubles (mocks/stubs).

Grain<TGrainState>()

Source:
Grain.cs

Initializes a new instance of the Grain<TGrainState> class.

protected Grain ();
Protected Sub New ()

Remarks

This constructor should never be invoked. We expose it so that client code (subclasses of this class) do not have to add a constructor. Client code should use the GrainFactory to get a reference to a Grain.

Applies to

Grain<TGrainState>(IStorage<TGrainState>)

Initializes a new instance of the Grain<TGrainState> class.

protected Grain (Orleans.Core.IStorage<TGrainState> storage);
new Orleans.Grain<'GrainState> : Orleans.Core.IStorage<'GrainState> -> Orleans.Grain<'GrainState>
Protected Sub New (storage As IStorage(Of TGrainState))

Parameters

storage
IStorage<TGrainState>

The storage implementation.

Remarks

Grain implementers do NOT have to expose this constructor but can choose to do so. This constructor is particularly useful for unit testing where test code can create a Grain and replace the IGrainIdentity, IGrainRuntime and State with test doubles (mocks/stubs).

Applies to

Grain<TGrainState>(IGrainIdentity, IGrainRuntime, IStorage<TGrainState>)

Source:
Grain.cs

Grain implementers do NOT have to expose this constructor but can choose to do so. This constructor is particularly useful for unit testing where test code can create a Grain and replace the IGrainIdentity, IGrainRuntime and State with test doubles (mocks/stubs).

protected Grain (Orleans.Core.IGrainIdentity identity, Orleans.Runtime.IGrainRuntime runtime, Orleans.Core.IStorage<TGrainState> storage);
new Orleans.Grain<'GrainState (requires 'GrainState : (new : unit -> 'GrainState))> : Orleans.Core.IGrainIdentity * Orleans.Runtime.IGrainRuntime * Orleans.Core.IStorage<'GrainState (requires 'GrainState : (new : unit -> 'GrainState))> -> Orleans.Grain<'GrainState (requires 'GrainState : (new : unit -> 'GrainState))>
new Orleans.Grain<'GrainState> : Orleans.Core.IGrainIdentity * Orleans.Runtime.IGrainRuntime * Orleans.Core.IStorage<'GrainState> -> Orleans.Grain<'GrainState>
Protected Sub New (identity As IGrainIdentity, runtime As IGrainRuntime, storage As IStorage(Of TGrainState))

Parameters

identity
IGrainIdentity
runtime
IGrainRuntime
storage
IStorage<TGrainState>

Applies to

Grain<TGrainState>(IGrainIdentity, IGrainRuntime, TGrainState, IStorage)

Grain implementers do NOT have to expose this constructor but can choose to do so. This constructor is particularly useful for unit testing where test code can create a Grain and replace the IGrainIdentity, IGrainRuntime and State with test doubles (mocks/stubs).

protected Grain (Orleans.Core.IGrainIdentity identity, Orleans.Runtime.IGrainRuntime runtime, TGrainState state, Orleans.Core.IStorage storage);
new Orleans.Grain<'GrainState (requires 'GrainState : (new : unit -> 'GrainState))> : Orleans.Core.IGrainIdentity * Orleans.Runtime.IGrainRuntime * 'GrainState * Orleans.Core.IStorage -> Orleans.Grain<'GrainState (requires 'GrainState : (new : unit -> 'GrainState))>
Protected Sub New (identity As IGrainIdentity, runtime As IGrainRuntime, state As TGrainState, storage As IStorage)

Parameters

identity
IGrainIdentity
runtime
IGrainRuntime
state
TGrainState
storage
IStorage

Applies to