Class ScopeOptions

Specifies the scope behavior.

Inheritance
System.Object
ScopeOptions
Implements
System.IEquatable<ScopeOptions>
Namespace: Solti.Utils.DI.Interfaces
Assembly: Solti.Utils.DI.Interfaces.dll
Syntax
public sealed class ScopeOptions : Object

Constructors

ScopeOptions()

Declaration
public ScopeOptions()

Properties

Default

The default options.

Declaration
public static ScopeOptions Default { get; }
Property Value
Type Description
ScopeOptions
Remarks

Modifying the Default value will impact the whole system. Therefore it's recommended to use the with pattern to set options when creating a scope:

ScopeFactory.Create(svcs => { ... }, ScopeOptions.Default with { ServiceResolutionMode = ... });

ResolutionLockTimeout

Specifies the maximum amount of time to wait to acquire the resolution lock.

Declaration
public TimeSpan ResolutionLockTimeout { get; set; }
Property Value
Type Description
System.TimeSpan
Remarks

This property is introduced mostly for debug purposes, it's recommended not to change it.

ServiceResolutionMode

Specifies the service resolution mode.

Declaration
public ServiceResolutionMode ServiceResolutionMode { get; set; }
Property Value
Type Description
ServiceResolutionMode
Remarks

It's recommended to use Ahead Of Time resolution because of its performance benefits, although Just In Time resolution is also useful when you want to mock the IInjector invocations.

StrictDI

Instructs the system to throw if

Declaration
public bool StrictDI { get; set; }
Property Value
Type Description
System.Boolean
Remarks

By default, scopes are permissives.

SupportsServiceProvider

Specifies whether the created scopes should implement the System.IServiceProvider interface.

Declaration
public bool SupportsServiceProvider { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Setting this property to true configures the Get(Type, Object) method to not throw if the requested dependency cannot be found.

Methods

<Clone>$()

Declaration
public ScopeOptions <Clone>$()
Returns
Type Description
ScopeOptions

Equals(ScopeOptions)

Declaration
public bool Equals(ScopeOptions other)
Parameters
Type Name Description
ScopeOptions other
Returns
Type Description
System.Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

Operators

Equality(ScopeOptions, ScopeOptions)

Declaration
public static bool operator ==(ScopeOptions left, ScopeOptions right)
Parameters
Type Name Description
ScopeOptions left
ScopeOptions right
Returns
Type Description
System.Boolean

Inequality(ScopeOptions, ScopeOptions)

Declaration
public static bool operator !=(ScopeOptions left, ScopeOptions right)
Parameters
Type Name Description
ScopeOptions left
ScopeOptions right
Returns
Type Description
System.Boolean

Implements

System.IEquatable<>
In This Article
Back to top Generated by DocFX