Class ServiceOptions

Specifies the general service behavior.

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

Constructors

ServiceOptions()

Declaration
public ServiceOptions()

Properties

AutoInject

If set to true, the system tries to resolve required properties, too.

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

Default

The default options.

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

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

coll.Service<IMyService, MyService>(Lifetime.Singleton, ServiceOptions.Default with { DisposalMode = ... });

DependencyResolvers

User defined dependency resolvers. Leave blank to use the default ones.

Declaration
public IReadOnlyList<IDependencyResolver> DependencyResolvers { get; set; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyList<IDependencyResolver>
Remarks

A IDependencyResolver specifies how to resolve a particular dependency type (for instance a lazy dependency). Default resolvers (in order) are:

DisposalMode

Contains the descriptor how to dispose created service instances.

Declaration
public ServiceDisposalMode DisposalMode { get; set; }
Property Value
Type Description
ServiceDisposalMode

ProxyEngine

The proxy engine to be used. Leave blank to use the default engine.

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

The default value for this property is provided by the ProxyGen.NET library.

SupportAspects

If set to true, the system tries to apply proxies defined via AspectAttribute class.

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

You may install interceptors directly by using the decorator recipe:

coll.Service<IMyService, MyService>().Decorate((injector, type, instance) => ...);

Methods

<Clone>$()

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

Equals(ServiceOptions)

Declaration
public bool Equals(ServiceOptions other)
Parameters
Type Name Description
ServiceOptions 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(ServiceOptions, ServiceOptions)

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

Inequality(ServiceOptions, ServiceOptions)

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

Implements

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