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
ITypeShapeProviderThe shape provider from which to extract the ITypeShape.
type
TypeThe type whose shape we need to resolve.
Returns
- ITypeShape
An ITypeShape instance corresponding to
type
.
Exceptions
- NotSupportedException
The
typeShapeProvider
does not supporttype
.
GetTypeShapeOrThrow<T>(ITypeShapeProvider)
Gets a ITypeShape<T> instance corresponding to the specified type.
public static ITypeShape<T> GetTypeShapeOrThrow<T>(this ITypeShapeProvider typeShapeProvider)
Parameters
typeShapeProvider
ITypeShapeProviderThe 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 supportT
.
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
ITypeShapeProviderThe 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.