Depending on your UI technology, writing a generic Equals override may not be possible.
I'm pretty sure Rocky touches on it in the 2008 book, but WPF and WinForms handle equality much differently. IIRC, Equals won't work in WPF. But not overriding them won't really work in WinForms. In fact, I think Rocky says that if you're using WPF (and, I would assume, by extension Silverlight), you shouldn't override either method - though I think overriding "GetIdValue" won't hurt.
Having said that, building a generic "Equals" override that you can put into your base class should be easy enough - just reference the "GetIdByValue" method, and override that in your subclasses to return whatever you need. It returns an object, so you can define your "object ID" however you want.
In terms of your Except method, Except can take an object that impments the generic IEqualityComparer interface. So instead of worrying about overriding Equals, you could always create an object that implements that interface, passing your BusinessBase type as the generic type. Then you just use that object in your Except (and several other LINQ method) calls. You can still override "GetIdValue", and just reference that in your IEqualityComparer implementation.
HTH
- Scott
Copyright (c) Marimer LLC