Table of Contents

Class ShapeExtensions

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Extension methods for the various type shape interfaces.

public static class ShapeExtensions
Inheritance
ShapeExtensions
Inherited Members

Methods

GetDefaultConstructor(IObjectTypeShape)

Retrieves the default constructor for the given type shape, if available.

public static Func<object>? GetDefaultConstructor(this IObjectTypeShape shape)

Parameters

shape IObjectTypeShape

The type's object shape.

Returns

Func<object>

A delegate for the default constructor; or null if none is available.

GetDefaultConstructor<T>(IObjectTypeShape<T>)

Retrieves the default constructor for the given type shape, if available.

public static Func<T>? GetDefaultConstructor<T>(this IObjectTypeShape<T> shape)

Parameters

shape IObjectTypeShape<T>

The type's object shape.

Returns

Func<T>

A delegate for the default constructor; or null if none is available.

Type Parameters

T

The type to be constructed.