Redigera

Dela via


Grain Constructors

Definition

Overloads

Grain()

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

Grain(IGrainIdentity, IGrainRuntime)

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 and IGrainRuntime with test doubles (mocks/stubs).

Grain(IGrainContext, IGrainRuntime)

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 and IGrainRuntime with test doubles (mocks/stubs).

Grain()

Source:
Grain.cs

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

protected Grain ();
Protected Sub New ()

Applies to

Grain(IGrainIdentity, IGrainRuntime)

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 and IGrainRuntime with test doubles (mocks/stubs).

protected Grain (Orleans.Core.IGrainIdentity identity, Orleans.Runtime.IGrainRuntime runtime);
new Orleans.Grain : Orleans.Core.IGrainIdentity * Orleans.Runtime.IGrainRuntime -> Orleans.Grain
Protected Sub New (identity As IGrainIdentity, runtime As IGrainRuntime)

Parameters

identity
IGrainIdentity
runtime
IGrainRuntime

Applies to

Grain(IGrainContext, IGrainRuntime)

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 and IGrainRuntime with test doubles (mocks/stubs).

protected Grain (Orleans.Runtime.IGrainContext grainContext, Orleans.Runtime.IGrainRuntime? grainRuntime = default);
new Orleans.Grain : Orleans.Runtime.IGrainContext * Orleans.Runtime.IGrainRuntime -> Orleans.Grain
Protected Sub New (grainContext As IGrainContext, Optional grainRuntime As IGrainRuntime = Nothing)

Parameters

grainContext
IGrainContext
grainRuntime
IGrainRuntime

Applies to