Why is the definition of the next class can access the private data elements other._nameand other._idfrom another object of the same class?
Thank.
public class MyData : IEquatable<MyData>
{
private long _id;
private string _name;
public bool Equals(MyData other)
{
bool ret =
string.Equals(_name, other._name) &&
long.Equals(_id, other._id);
return ret;
}
}
source
share