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
typeShapeProviderITypeShapeProviderThe shape provider from which to extract the ITypeShape.
typeTypeThe type whose shape we need to resolve.
Returns
- ITypeShape
An ITypeShape instance corresponding to
type.
Exceptions
- NotSupportedException
The
typeShapeProviderdoes 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
typeShapeProviderITypeShapeProviderThe shape provider from which to extract the ITypeShape.
Returns
- ITypeShape<T>
An ITypeShape<T> instance corresponding to
T.
Type Parameters
TThe type whose shape should be resolved.
Exceptions
- NotSupportedException
The
typeShapeProviderdoes 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
typeShapeProviderITypeShapeProviderThe 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
TThe type whose shape should be resolved.