public bool Equals(MongoRef <T> other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(EqualityComparer <T> .Default.Equals(Reference, other.Reference)); }
public override void Serialize(BsonSerializationContext context, BsonSerializationArgs args, MongoRef <T> value) { context.Writer.WriteObjectId(new ObjectId(value.ReferenceId)); }