Interface IMethodShape
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for a given .NET method.
public interface IMethodShape
Properties
AttributeProvider
Gets the provider used for method-level attribute resolution.
ICustomAttributeProvider? AttributeProvider { get; }
Property Value
DeclaringType
Gets the shape of the declaring type for the method.
ITypeShape DeclaringType { get; }
Property Value
IsAsync
bool IsAsync { get; }
Property Value
IsPublic
Gets a value indicating whether the method is declared public.
bool IsPublic { get; }
Property Value
IsStatic
Gets a value indicating whether the method is static.
bool IsStatic { get; }
Property Value
IsVoidLike
bool IsVoidLike { get; }
Property Value
Remarks
When true the ReturnType is reported as Unit,
Name
Gets the name of the method.
string Name { get; }
Property Value
Parameters
Gets the shapes of the parameters accepted by the method.
IReadOnlyList<IParameterShape> Parameters { get; }
Property Value
ReturnType
Gets the shape of the return type of the method.
ITypeShape ReturnType { get; }
Property Value
Methods
Accept(TypeShapeVisitor, object?)
Accepts an TypeShapeVisitor for strongly-typed traversal.
object? Accept(TypeShapeVisitor visitor, object? state = null)
Parameters
visitor
TypeShapeVisitorThe visitor to accept.
state
objectThe state parameter to pass to the underlying visitor.