NHibernate proxy causing problems with databinding

后端 未结 5 1366
庸人自扰
庸人自扰 2021-01-20 05:34

I have a gridview that is bound to the result from an nhibernate query. If the first item in the list is edited the following exception is thrown:

System.Refle

5条回答
  •  我在风中等你
    2021-01-20 06:15

    Another solution is to Join Fetch the relation if you know you are going to be Databinding it. E.g. add .SetFetchMode("People", FetchMode.Join). NHibernate should return only domain objects since none of them should be lazy loaded.

提交回复
热议问题