NHibernate proxy causing problems with databinding

后端 未结 5 1323
庸人自扰
庸人自扰 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:11

    Is the root cause due to a proxy object in the list (from lazy loading) or because the list isn't homogeneous (contains multiple types even if they belong to the same class hierarchy)? The problem with non-homogeneous data sets is a known limitation. See this and this.

    I don't think there's a solution other than to not use databinding to populate the grid. That's easy enough if it's read-only.

提交回复
热议问题