I think what the code is trying to do is say "it still has an identifier", i.e. the transition object can (if I read the code correctly), which has not yet been saved to the database. Then equality is defined as:
- If it has an identifier, does it match? (even for different instances of the same type)
- If it does not have an identifier, this is the same instance of the object (link)
Unfortunately, the implementation seems to be completely broken, since Equals(ID, default(T)) meaningless when T is something completely different (a BusinessObject<T> ) - hence default(T) will always be null , and the ID will never be null (it cannot be null). Therefore, nothing will ever report the passing.
In addition, this code:
if (null == other || !GetType().IsInstanceOfType(other))
highly ineffective. I suspect that something related to as would be much preferable, but then again: the code looks like this ... tortured ... that I don't want to guess the intent.
source share