Table of Contents

Interface IMethodShape<TDeclaringType, TArgumentState, TResult>

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Provides a strongly typed shape model for a given .NET method.

public interface IMethodShape<TDeclaringType, TArgumentState, TResult> : IMethodShape where TArgumentState : IArgumentState

Type Parameters

TDeclaringType

The declaring type for the method.

TArgumentState

The mutable state type used for aggregating method arguments.

TResult

The return type of the underlying method.

Inherited Members

Remarks

For underlying methods returning void, Task, or ValueTask the TResult type is represented with Unit.

Properties

DeclaringType

Gets the shape of the declaring type for the method.

ITypeShape<TDeclaringType> DeclaringType { get; }

Property Value

ITypeShape<TDeclaringType>

ReturnType

Gets the shape of the return type of the method.

ITypeShape<TResult> ReturnType { get; }

Property Value

ITypeShape<TResult>

Methods

GetArgumentStateConstructor()

Gets a delegate for creating a default argument state instance.

Func<TArgumentState> GetArgumentStateConstructor()

Returns

Func<TArgumentState>

A delegate for creating an argument state instance with default parameter values.

Exceptions

InvalidOperationException

The Parameters property of the method is empty.

GetMethodInvoker()

Gets a delegate for invoking the method with the provided argument state.

MethodInvoker<TDeclaringType, TArgumentState, TResult> GetMethodInvoker()

Returns

MethodInvoker<TDeclaringType, TArgumentState, TResult>

A MethodInvoker<TDeclaringType, TArgumentState, TResult> delegate.