Interface IConstructorShape<TDeclaringType, TArgumentState>
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for a given .NET constructor.
public interface IConstructorShape<TDeclaringType, TArgumentState> : IConstructorShape
Type Parameters
TDeclaringType
The declaring type of the underlying constructor.
TArgumentState
The state type used for aggregating constructor arguments.
- Inherited Members
Properties
DeclaringType
The shape of the declaring type for the constructor.
IObjectTypeShape<TDeclaringType> DeclaringType { get; }
Property Value
- IObjectTypeShape<TDeclaringType>
Methods
GetArgumentStateConstructor()
Creates a constructor delegate for creating a default argument state instance.
Func<TArgumentState> GetArgumentStateConstructor()
Returns
- Func<TArgumentState>
A delegate for constructing new
TArgumentState
instances.
Exceptions
- InvalidOperationException
The ParameterCount of the constructor is zero.
GetDefaultConstructor()
Creates a delegate wrapping a parameterless constructor, if applicable.
Func<TDeclaringType> GetDefaultConstructor()
Returns
- Func<TDeclaringType>
A parameterless delegate creating a default instance of
TArgumentState
.
Exceptions
- InvalidOperationException
The ParameterCount of the constructor is not zero.
GetParameterizedConstructor()
Creates a constructor delegate parameterized on an argument state object.
Constructor<TArgumentState, TDeclaringType> GetParameterizedConstructor()
Returns
- Constructor<TArgumentState, TDeclaringType>
A parameterized delegate returning an instance of
TDeclaringType
.
Exceptions
- InvalidOperationException
The ParameterCount of the constructor is zero.