Class NullableHelper
A framework independent utility class for the new Nullable type in .NET Framework 2.0
Inheritance
System.Object
NullableHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.ComponentModel
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class NullableHelper
Constructors
NullableHelper()
Declaration
public NullableHelper()
Methods
ChangeType(Object, Type)
Use this method instead of Convert.ChangeType. Makes Convert.ChangeType work with Nullable types.
Declaration
public static object ChangeType(object value, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | |
System.Type | type |
Returns
Type |
---|
System.Object |
ChangeType(Object, Type, IFormatProvider)
Use this method instead of Convert.ChangeType. Makes Convert.ChangeType work with Nullable types.
Declaration
public static object ChangeType(object value, Type type, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | |
System.Type | type | |
System.IFormatProvider | provider |
Returns
Type |
---|
System.Object |
FixDbNUllasNull(Object, Type)
Returns null if value is DBNull and specified type is a Nullable type. Otherwise the value is returned unchanged.
Declaration
public static object FixDbNUllasNull(object value, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | |
System.Type | type |
Returns
Type |
---|
System.Object |
GetUnderlyingType(Type)
Returns the underlying type of a Nullable type. For .NET 1.0 and 1.1 this method will always return null.
Declaration
public static Type GetUnderlyingType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type |
Returns
Type |
---|
System.Type |