Interface ITypeShape
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for a given .NET type.
public interface ITypeShape
Properties
AttributeProvider
Gets the provider used for type-level attribute resolution.
ICustomAttributeProvider? AttributeProvider { get; }
Property Value
Kind
Gets determines the TypeShapeKind that the current shape supports.
TypeShapeKind Kind { get; }
Property Value
Provider
Gets the provider used to generate this instance.
ITypeShapeProvider Provider { get; }
Property Value
Type
Gets 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 func, object? state = null)
Parameters
func
ITypeShapeFuncThe generic function to be invoked.
state
objectThe state to be passed to the function.
Returns
- object
The result produced by the function.