Class TypeShapeProvider
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Helper methods for extracting ITypeShape instances from shape providers.
public static class TypeShapeProvider
- Inheritance
-
TypeShapeProvider
- Inherited Members
Methods
Resolve(ITypeShapeProvider, Type)
Resolves the ITypeShape corresponding to type
.
public static ITypeShape Resolve(this ITypeShapeProvider shapeProvider, Type type)
Parameters
shapeProvider
ITypeShapeProviderThe provider from which to extract the ITypeShape.
type
TypeThe type whose shape we need to resolve.
Returns
- ITypeShape
An ITypeShape instance describing
type
.
Exceptions
- NotSupportedException
shapeProvider
does not supporttype
.
Resolve<T>()
Resolves the ITypeShape provided by the given type.
public static ITypeShape<T> Resolve<T>() where T : IShapeable<T>
Returns
- ITypeShape<T>
An ITypeShape instance describing
T
.
Type Parameters
T
The type from which to extract the shape.
Resolve<T>(ITypeShapeProvider)
Resolves the ITypeShape<T> corresponding to T
.
public static ITypeShape<T> Resolve<T>(this ITypeShapeProvider shapeProvider)
Parameters
shapeProvider
ITypeShapeProviderThe provider from which to extract the ITypeShape.
Returns
- ITypeShape<T>
An ITypeShape<T> instance describing
T
.
Type Parameters
T
The type whose shape we need to resolve.
Exceptions
- NotSupportedException
shapeProvider
does not supportT
.
Resolve<T, TProvider>()
Resolves the ITypeShape provided by the given type.
public static ITypeShape<T> Resolve<T, TProvider>() where TProvider : IShapeable<T>
Returns
- ITypeShape<T>
An ITypeShape instance describing
T
.
Type Parameters
T
The type for which to extract the shape.
TProvider
The type from which to extract the shape.