Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Nullable(T).Equals Method

Indicates whether the current Nullable(T) object is equal to a specified object.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

abstract Equals : 
        other:Object -> bool  
override Equals : 
        other:Object -> bool

Parameters

other
Type: System.Object

An object.

Return Value

Type: System.Boolean
true if the other parameter is equal to the current Nullable(T) object; otherwise, false.
This table describes how equality is defined for the compared values:

Return Value

Description

true

The HasValue property is false, and the other parameter is a null reference (Nothing in Visual Basic). That is, two null values are equal by definition.

-or-

The HasValue property is true, and the value returned by the Value property is equal to the other parameter.

false

The HasValue property for the current Nullable(T) structure is true, and the other parameter is a null reference (Nothing in Visual Basic).

-or-

The HasValue property for the current Nullable(T) structure is false, and the other parameter is not a null reference (Nothing in Visual Basic).

-or-

The HasValue property for the current Nullable(T) structure is true, and the value returned by the Value property is not equal to the other parameter.

If the HasValue property of the current Nullable(T) structure is true, equality is determined by passing the other parameter to the Equals method of the underlying value of the current Nullable(T) structure.

The following code example determines whether an object and a Nullable(T) object are equal to the current Nullable(T) object.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft