Is there a way to map a class that has two references to a table that
has a composite key?

For example I have two objects.  An OrderLine object and a ProductUom
object.  The OrderLine object has two references to the ProductUom
object.  The ProductUom's primary keys are a guid and an int.  The
OrderLine has a guid and two ints that make up the two references.

The problem is that since these two references share the same column
(guid) in the OrderLine I run into issues with my mapping. I can't
think of a good way to map this.  I tried mapping them as two standard
many-to-one but I get the error:
System.IndexOutOfRangeException: Invalid index 17 for this
SqlParameterCollection with Count=17.

I think this is being caused because I'm referencing the same column
twice between my two many-to-one's.

Is there a way to map this without changing my database model?

More details on this question can be found here:
http://stackoverflow.com/questions/7167516/mapping-two-references-in-the-same-class-but-reference-class-has-composite-key

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