如何比较两个RealmObject,特别是当对象是:
时管理/未管理
public class SomeObject : RealmObject {
//... properties here
public override bool Equals(object obj){
if (object.ReferenceEquals(this, obj)){
return true;
}
if (!(obj is SomeObject other)){
return false;
}
var areEqual = base.Equals(obj);
if (this.IsValid && other.IsValid){
return base.Equals(obj);
}
if (!this.IsValid && !other.IsValid){
if (!areEqual){ }
return true;
}
if (areEqual){}
return false;
}
}