Class DerivedTypes
- Namespace
- Cratis.Serialization
- Assembly
- Cratis.Fundamentals.dll
Represents an implementation of IDerivedTypes.
[Singleton]
public class DerivedTypes : IDerivedTypes
- Inheritance
-
DerivedTypes
- Implements
- Inherited Members
- Extension Methods
Constructors
DerivedTypes(ITypes)
Initializes a new instance of ITypes.
public DerivedTypes(ITypes types)
Parameters
Fields
Instance
Gets the global instance of DerivedTypes.
public static readonly DerivedTypes Instance
Field Value
Remarks
Its recommended to use the singleton defined here, rather than building your own instance. This is due to the performance impact of scanning all assemblies in the application.
Properties
TypesWithDerivatives
Gets all the types that has derivatives.
public IEnumerable<Type> TypesWithDerivatives { get; }
Property Value
Methods
GetDerivedTypeFor(Type, DerivedTypeId)
Get the derived type for a target type.
public Type GetDerivedTypeFor(Type targetType, DerivedTypeId derivedTypeId)
Parameters
targetTypeTypeTarget type to get for.
derivedTypeIdDerivedTypeIdThe unique identifier of the derived type.
Returns
- Type
The derived type.
GetTargetTypeFor(Type)
Get the target type from a derived type.
public Type GetTargetTypeFor(Type derivedType)
Parameters
derivedTypeTypeDerived type to get from.
Returns
- Type
The target type.
HasDerivatives(Type)
Check if a type has derivative types.
public bool HasDerivatives(Type type)
Parameters
typeTypeType to check.
Returns
- bool
True if it has derivatives, false if not.
IsDerivedType(Type)
Check if a type is a derived type.
public bool IsDerivedType(Type type)
Parameters
typeTypeType to check.
Returns
- bool
True if it is a derived type, false if not.