HostedActivityServiceOptions.UseScopedServices Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.