Indicates whether two specified
NullableT objects are equal.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static bool Equals<T>(
Nullable<T> n1,
Nullable<T> n2
)
where T : struct, new()
Parameters
- n1
- Type: SystemNullableT
A NullableT object. - n2
- Type: SystemNullableT
A NullableT object.
Type Parameters
- T
- The underlying value type of the n1 and n2 parameters.
Return Value
Type:
Booleantrue if the
n1 parameter is equal to the
n2 parameter; otherwise, false. The return value depends on the
HasValue and
Value properties of the two parameters that are compared.Return ValueDescriptiontrueThe
HasValue properties for
n1 and
n2 are false. -or-The
HasValue properties for
n1 and
n2 are true, and the
Value properties of the parameters are equal.falseThe
HasValue property is true for one parameter and false for the other parameter.-or-The
HasValue properties for
n1 and
n2 are true, and the
Value properties of the parameters are unequal.
See Also