I don't know if you can use a custom iequalitycomparer, but if it is so and
you
don't want to 'dirty' your classes maybe you can use:
http://remix.codeplex.com/
Example: https://www.re-motion.org/download/HOL_mixin_equals.pdf 

Michael

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of kor
Sent: Monday, July 04, 2011 4:04 PM
To: nhusers
Subject: [nhusers] it's possible to specify the iequalitycomparer used by a
map?

hi all, i'm using nh 3.2.0.1003 in a net 2.0 project

i have this 2 classes

class ClassA
(
    Guid Id
)

class ClassB
(
   Guid Id
   IDictionary<ClassA, bool> Data
)

i map them with xml, for the property Data i use

    <map name="Data">
      <key column="ClassB_Id" />
        <index-many-to-many class="ClassA" column="ClassA_Id" />
         <element column="State"
               type="System.Boolean"
               not-null="true"/>
    </map>

by default it doesn't work becouse dictionary uses default
object.equal implementation,
i want know if i can set the custom implementation of
iequalitycomparer used by Data property or if i can only
overide equals in classB (as in
http://nhforge.org/blogs/nhibernate/archive/2008/09/06/identity-field-equali
ty-and-hash-code.aspx).

if i can set my custom iequalitycomparer will be better becouse i
don't dirty my class ClassA.

thanks

-- 
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to