С TortoiseSVN можно сделать правильное-clic перетаскивание & отбросьте свою папку и затем выберите команду "SVN Export All to here".
The results you see come from a design compromise, Tuples are now shared between F# and C#. The main point is that all Tuples are indeed implemented as reference types, that was not so obvious.
The decision whether Tuples should do deep or shallow equality checks was moved to two interfaces: IStructuralComparable
, IStructuralEquatable
. Note that those 2 are now also implemented by the Array class.
For Reference Type: == performs an identity comparison, i.e. it will only return true if both references point to the same object. While Equals() method is expected to perform a value comparison, i.e. it will return true if the references point to objects that are equivalent.
For reference types where == has NOT been overloaded, it compares whether two references refer to the same object
By default, the operator == tests for reference equality, so Yes the result you are seeing is expected.
See Guidelines for Overriding Equals() and Operator == (C# Programming Guide):
In C#, there are two different kinds of equality: reference equality (also known as identity) and value equality. Value equality is the generally understood meaning of equality: it means that two objects contain the same values. For example, two integers with the value of 2 have value equality. Reference equality means that there are not two objects to compare.
By default, ==
(on a class) means reference equality; i.e. are they the same instance; what object.ReferenceEquals(x,y)
would return.
You can provide your own == / != operators to get the expected behaviour - and when you override Equals
it is important to override GetHashCode
too (otherwise you break usage as a key - Why is it important to override GetHashCode when Equals method is overriden in C#?):
public static bool operator == (NameAndNumber x, NameAndNumber y) {
if (x == null && y == null) return true;
if (x == null || y == null) return false;
return x.Number == y.Number && x.Name == y.Name;
// or if polymorphism is important: return x.Equals(y);
}
public static bool operator !=(NameAndNumber x, NameAndNumber y) {
return !(x == y); // lazy but works
}
public override int GetHashCode() {
return (Name == null ? 0 : Name.GetHashCode()) +
17 * Number.GetHashCode();
}