Open sandboxFocus

Class DependencyOptions

Specifies options for a dependency introduced by IntroduceDependency(IAdviser<INamedType>, IType, DependencyOptions?).

Inheritance
DependencyOptions
Namespace: Metalama.Extensions.DependencyInjection
Assembly: Metalama.Extensions.DependencyInjection.dll
Syntax
[CompileTime]
public sealed record DependencyOptions : IEquatable<DependencyOptions>

Constructors

Name Description
DependencyOptions()

Properties

Name Description
Default

Gets the default DependencyOptions instance.

IsLazy

Gets or sets a value indicating whether the dependency should be resolved lazily upon first use. When set to false, the dependency is resolved during object construction.

IsRequired

Gets or sets a value indicating whether the dependency is required. When set to false, the generated code will accept missing dependencies without throwing an exception.

IsStatic

Gets or sets a value indicating whether the dependency field or property is static.

MemberKind

Gets or sets the kind of member to introduce, either Field or Property. The default is Field.

MemberName

Gets or sets the name of the field or property that will expose the dependency in the target type.

Methods

Name Description
Equals(DependencyOptions?)
Equals(object?)
GetHashCode()
ToString()

Operators

Name Description
operator ==(DependencyOptions?, DependencyOptions?)
operator !=(DependencyOptions?, DependencyOptions?)

Extension Methods

See Also