Class TypeForwardServiceOptions
- Assembly
- Cuemon.Extensions.DependencyInjection.dll
Configuration options for Microsoft Dependency Injection that support nested type forwarding.
public class TypeForwardServiceOptions : ServiceOptions, IValidatableParameterObject, IParameterObject
- Inheritance
-
TypeForwardServiceOptions
- Implements
- Inherited Members
- Extension Methods
Constructors
TypeForwardServiceOptions()
Initializes a new instance of the ServiceOptions class.
public TypeForwardServiceOptions()
Remarks
The following table shows the initial property values for an instance of ServiceOptions.
Property | Initial Value |
---|---|
NestedTypePredicate | serviceType => serviceType.GetInterfaces(); |
NestedTypeSelector | _ => true; |
Properties
NestedTypePredicate
Gets or sets the function delegate that will test each element for a condition based on a Type.
public Func<Type, bool> NestedTypePredicate { get; set; }
Property Value
- Func<Type, Boolean>
The function delegate that will test each element for a condition based on a Type.
NestedTypeSelector
Gets or sets the function delegate that will fetch nested types of a service.
public Func<Type, IEnumerable<Type>> NestedTypeSelector { get; set; }
Property Value
- Func<Type, IEnumerable<Type>>
The function delegate that will fetch nested types of a service.
UseNestedTypeForwarding
Gets or sets a value indicating whether nested type forwarding should be part of the operation.
public bool UseNestedTypeForwarding { get; set; }
Property Value
- Boolean
true
if nested type forwarding should be part of the operation; otherwise,false
.
Methods
ValidateOptions()
Determines whether the public read-write properties of this instance are in a valid state.
public void ValidateOptions()
Remarks
This method is expected to throw exceptions when one or more conditions fails to be in a valid state.
Exceptions
- InvalidOperationException
NestedTypePredicate cannot be null - or - NestedTypeSelector cannot be null.