ภาษา

HostedActivityServiceOptions.UseScopedServices Property

Definition

Gets or sets a value indicating whether each queued Activity is processed in its own dependency injection scope.

public bool UseScopedServices { get; set; }
member this.UseScopedServices : bool with get, set
Public Property UseScopedServices As Boolean

Property Value

Remarks

When true (the default), the IAgent and its dependencies are resolved from a scope that is disposed when the turn completes. Set this to false to resolve from the root IServiceProvider instead. Root resolution promotes scoped registrations in the Agent's dependency graph to the root scope, sharing one instance across turns for the lifetime of the process.

Applies to