Please make a checkbox for IEquatable Implementation

Oct 26, 2010 at 10:33 PM

Hi, I have been running into a nice(or not) feature of the Silverlight datagrid, which is to take, by default, the Equals method for comparison.  

When using List.AddNew(), my ID's are = 0, which means .Equals() will return true, which in turn prevents the user from selecting identical records.  This is problematic.  A nice fix would be to be able to remove the IEquatable Implementation for a given object using the EntityModel's custom properties.  Thanks.

Oct 27, 2010 at 8:05 AM


No problem, I'll add this request to our IssueTracker. It will be published in version 1.0.2 as soon as possible. 



Oct 27, 2010 at 8:06 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 27, 2010 at 10:09 AM


I've implemented this request and have created new release. This is not recommended public release but if you want to try it you can download it from the Downloads page (on the right side navigate to Version 1.0.2. ALFA). If you install new version be sure to replace T4 file.

Implementation details: 

I've added two properties:

EF designer => Csla Generate Equals, where you can set generation rules for all entities in the model. By default IEquatable is implemented for all objects, and using this property you can change that.

Entity => Csla Generate Equals; here you can set generation rules for one entity. By default rule is inherited from model, but using this property you can override that behavior





Oct 27, 2010 at 2:33 PM

Thanks a lot!!

Oct 27, 2010 at 6:36 PM

I think there is a bug : when I choose to not have IEquatable at all(with the edmx's properties), the implemented methods are not present(100% what I want), but there is still the reference to IEquatable in the class definition, which causes the classes not to compile.  Thanks Again!

Oct 27, 2010 at 8:49 PM

Bug fixed. I have replaced the vsix package.