Class TypeExtension
- Namespace
- TimeCockpit.Data
- Assembly
- TimeCockpit.Data.dll
Defines extension methods for the Type class
public static class TypeExtension
- Inheritance
-
ObjectTypeExtension
- Inherited Members
-
Object.ToString()Object.Equals(Object)Object.Equals(Object, Object)Object.ReferenceEquals(Object, Object)Object.GetHashCode()Object.GetType()Object.MemberwiseClone()
Methods
HasEqualBaseType(Type, Type)
Determines whether if two types are equal or, if nullable, have the same basetype.
public static bool HasEqualBaseType(this Type sourceType, Type typeToCompare)
Parameters
sourceTypeTypeType of the source.
typeToCompareTypeThe type to compare.
Returns
- Boolean
trueif the types are equal or, if nullable, have the same base types; otherwise,false.
IsNullableType(Type)
Gets a value indicating whether type is a generic type and the generic type for type
is Nullable<>
public static bool IsNullableType(this Type type)
Parameters
typeTypeType to check
Returns
- Boolean
true if
typeis a generic type and the generic type fortypeisNullable<>, otherwise false.