Table of Contents

Class TypeShapeProviderExtensions

Namespace
PolyType
Assembly
PolyType.dll

Extension methods for the ITypeShapeProvider interface.

public static class TypeShapeProviderExtensions
Inheritance
TypeShapeProviderExtensions
Inherited Members

Methods

GetTypeShapeOrThrow(ITypeShapeProvider, Type)

Gets a ITypeShape instance corresponding to the specified type, or throw if one doesn't exist.

public static ITypeShape GetTypeShapeOrThrow(this ITypeShapeProvider typeShapeProvider, Type type)

Parameters

typeShapeProvider ITypeShapeProvider

The shape provider from which to extract the ITypeShape.

type Type

The type whose shape we need to resolve.

Returns

ITypeShape

An ITypeShape instance corresponding to type.

Exceptions

NotSupportedException

The typeShapeProvider does not support type.

GetTypeShapeOrThrow<T>(ITypeShapeProvider)

Gets a ITypeShape<T> instance corresponding to the specified type.

public static ITypeShape<T> GetTypeShapeOrThrow<T>(this ITypeShapeProvider typeShapeProvider)

Parameters

typeShapeProvider ITypeShapeProvider

The shape provider from which to extract the ITypeShape.

Returns

ITypeShape<T>

An ITypeShape<T> instance corresponding to T.

Type Parameters

T

The type whose shape should be resolved.

Exceptions

NotSupportedException

The typeShapeProvider does not support T.

GetTypeShape<T>(ITypeShapeProvider)

Gets a ITypeShape<T> instance corresponding to the specified type, or throw if one doesn't exist.

public static ITypeShape<T>? GetTypeShape<T>(this ITypeShapeProvider typeShapeProvider)

Parameters

typeShapeProvider ITypeShapeProvider

The shape provider from which to extract the ITypeShape.

Returns

ITypeShape<T>

An ITypeShape<T> instance corresponding to T, or null if a shape is not available.

Type Parameters

T

The type whose shape should be resolved.