Interface ITypeShape
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for a given .NET type.
public interface ITypeShape
Properties
AttributeProvider
The provider used for type-level attribute resolution.
ICustomAttributeProvider? AttributeProvider { get; }
Property Value
Kind
Determines the TypeShapeKind that the current shape supports.
TypeShapeKind Kind { get; }
Property Value
Provider
The provider used to generate this instance.
ITypeShapeProvider Provider { get; }
Property Value
Type
The underlying Type that this instance represents.
Type Type { get; }
Property Value
Methods
Accept(ITypeShapeVisitor, object?)
Accepts an ITypeShapeVisitor for strongly-typed traversal.
object? Accept(ITypeShapeVisitor visitor, object? state = null)
Parameters
visitor
ITypeShapeVisitorThe visitor to accept.
state
objectThe state parameter to pass to the underlying visitor.
Returns
Invoke(ITypeShapeFunc, object?)
Invokes the specified generic function with the given state.
object? Invoke(ITypeShapeFunc function, object? state = null)
Parameters
function
ITypeShapeFuncThe generic function to be invoked.
state
objectThe state to be passed to the function.
Returns
- object
The result produced by the function.