Interface IConstructorShape
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for a given .NET constructor.
public interface IConstructorShape
Properties
AttributeProvider
Gets the provider used for method-level attribute resolution.
IGenericCustomAttributeProvider AttributeProvider { get; }
Property Value
Remarks
Provides fast attribute resolution when using the source generator, otherwise this is wrapping standard reflection-based attribute resolution.
When using the source generator, the following categories of attributes are excluded to reduce trimmed application size:
System.Runtime.CompilerServices.*- Compiler-generated attributesSystem.Runtime.InteropServices.*- COM interop attributesSystem.Diagnostics.*- Diagnostic attributesSystem.Reflection.DefaultMemberAttribute- Default member metadataSystem.CLSCompliantAttribute- CLS compliance markerMicrosoft.FSharp.Core.*- F# compiler generated attributes- Attributes marked with unmet ConditionalAttribute annotations
DeclaringType
Gets the shape of the declaring type for the constructor.
IObjectTypeShape DeclaringType { get; }
Property Value
IsPublic
Gets a value indicating whether the constructor is declared public.
bool IsPublic { get; }
Property Value
MethodBase
Gets the underlying MethodBase corresponding to the constructor, if applicable.
MethodBase? MethodBase { get; }
Property Value
Parameters
Gets the shapes of the parameters accepted by the constructor.
IReadOnlyList<IParameterShape> Parameters { get; }
Property Value
Remarks
Includes all formal parameters of the underlying constructor, as well as any member that can be specified in a member initializer expression.
Methods
Accept(TypeShapeVisitor, object?)
Accepts an TypeShapeVisitor for strongly-typed traversal.
object? Accept(TypeShapeVisitor visitor, object? state = null)
Parameters
visitorTypeShapeVisitorThe visitor to accept.
stateobjectThe state parameter to pass to the underlying visitor.