Hello,

       Am working on the mapping Composite Keys(NUMBER+ CLIENTID) for
Table , Here both these keys are primary Keys and NUMBER field is
autogenerated and set as Identity in Database. am facing a  problem
for mapping these fields as composite keys.

Error : "a different object with the same identifier value was already
associated with the session"..---> this is becoz in Database this
column is already set as Identity Column ..

Please refer the below code

public cliPendingBankruptcyMap()
        {
            Table("cliPendingBankruptcy");
            LazyLoad();
            CompositeId()
               .KeyReference(x => x.usrClient, "CLIENTID")
               .KeyProperty(x => x.NUMBER, "NUMBER");// HOW TO SET
THIS FIELD AS IDENTITY.
            Map(x => x.NAME).Column("NAME");
            Map(x => x.CASENO).Column("CASENO");
            Map(x => x.DATE).Column("DATE");
            Map(x => x.DISTRICT).Column("DISTRICT");
            Map(x => x.RELATION).Column("RELATION");
            Map(x => x.JUDGE).Column("JUDGE");
        }

How can we set the Identity property  for NUMBER field in the above
CompositeId()?? , So what approach should we need to follow for
mapping the NUMBER field as Identity in  the above code.

Your thoughts?

-- 
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