Table of Contents

Class TypeExtension

Namespace
TimeCockpit.Data
Assembly
TimeCockpit.Data.dll

Defines extension methods for the Type class

public static class TypeExtension
Inheritance
Object
TypeExtension
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

sourceType Type

Type of the source.

typeToCompare Type

The type to compare.

Returns

Boolean

true if 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

type Type

Type to check

Returns

Boolean

true if type is a generic type and the generic type for type is Nullable<>, otherwise false.