“Invalid Index n for this SqlParameterCollection with Count=n” OR “foreign key cannot be null”

前端 未结 1 1964
清歌不尽
清歌不尽 2021-01-03 18:57

I have been successfully using NHibernate for quite some time now and have been able to solve a lot of pitfalls with an application that I developed with it and that is ru

1条回答
  •  鱼传尺愫
    2021-01-03 19:51

    Aaargh! I was put so much on a wrong leg with this infamous “Invalid Index n for this SqlParameterCollection with Count=n” error that I overlooked the obvious: A duplicate mapping of a field for ONE of the classes. In that particular mapping I left this error, where the primary key is also defined as a property:

     
       
     
      
    

    Now that was a waste of time trying to debug that!

    0 讨论(0)
提交回复
热议问题