What is the reason of this error? My class is Course and it has notes. Mapping is as below. Any idea?
<bag name="Notes" table="NOTE" cascade="all">
<key column="COURSEID"/>
<one-to-many class="Server.Data.Note, Server开发者_Go百科.Data"/>
</bag>
<bag name="Notes" table="NOTE" cascade="all" inverse="true">
<key column="COURSEID"/>
<one-to-many class="Server.Data.Note, Server.Data"/>
</bag>
inverse="true" solves my problem :)
I my case the reason was that I was mapping a list to an abstract type (during a refactoring). When I changed the class from being abstract, it worked.
In my case the reason was that I converted an int to an enum (public enum FieldType : int { }
).
Somehow, that convertion made an error jump where a Field had no Question. I made Question_id not nullable directly in the db, and removed the Fields with null question_id... and the error disappeared. (Replaced by another one, Can't parse 32 as int.. But still, improvement. I think the db type needs to be different.)
"Any sufficiently advanced technology is indistinguishable from magic."
精彩评论