NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Identity and Equality of Values

There are two binary operators defined on all pairs of values, identity and equality, which return a Boolean result. Both of these operators are mathematical equivalence operators, i.e. they are:

In addition, identity always implies equality, but not the reverse, i.e., the equality operator need not be the same as the identity operator as long as two identical values are also equal values.

To understand the difference between these operations, consider three variables whose type is System.String, where the arrow is intended to mean “is a reference to”:

The values of the variables are identical if the locations of the sequences of characters are the same, i.e., there is in fact only one string in memory. The values stored in the variables are equal if the sequences of characters are the same. Thus, the values of variables A and B are identical, the values of variables A and C as well as B and C are not identical, and the values of all three of A, B, and C are equal.

Identity

The identity operator is defined by the VOS as follows.

Equality

The exact types of the values supply the equality operator. Definitions of equality must obey the following two rules: