Class Nullable<T>
Initializes a new instance of the Nullable<T> structure.
Inheritance
Namespace: Syncfusion.Maui.DataSource
Assembly: Syncfusion.Maui.DataSource.dll
Syntax
public sealed class Nullable<T> : ValueType where T : struct, ValueType
Type Parameters
Name | Description |
---|---|
T | Represents the generic type parameter. |
Constructors
Nullable(T)
Initializes a new instance of the Nullable<T> struct.
Declaration
public Nullable(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Represents the generic value. |
Properties
HasValue
Gets a value indicating whether object has a value.
Declaration
public bool HasValue { get; }
Property Value
Type |
---|
System.Boolean |
Value
Gets the generic type value.
Declaration
public T Value { get; }
Property Value
Type |
---|
T |
Methods
Equals(Object)
Override method to check whether the internal value is equal to obtained value.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other | Represents the obtained object. |
Returns
Type | Description |
---|---|
System.Boolean | Returns the boolean value accordingly. |
GetHashCode()
Override method to get the HashCode.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Returns the boolean value accordingly. |
GetValueOrDefault()
Get the default value.
Declaration
public T GetValueOrDefault()
Returns
Type | Description |
---|---|
T | Returns the internal value. |
GetValueOrDefault(T)
Helper method to get the internal or default value.
Declaration
public T GetValueOrDefault(T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
T | defaultValue | Represents the generic type parameter. |
Returns
Type | Description |
---|---|
T | Returns the parameter value. |
ToString()
Override method to convert the specified value into string value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Returns the string value accordingly. |
Operators
Explicit(Nullable<T> to T)
Determines the generic value explicitly.
Declaration
public static explicit operator T(Nullable<T> value)
Parameters
Type | Name | Description |
---|---|---|
Nullable<T> | value | Represents the generic parameter value. |
Returns
Type |
---|
T |
Implicit(T to Nullable<T>)
Determines the generic value implicitly.
Declaration
public static implicit operator Nullable<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Represents the generic parameter value. |
Returns
Type |
---|
Nullable<T> |