NHibernate默认使用代理功能,要求持久化类不是sealed的,而且其公共方法、属性和事件声明为virtual。在这里,类中的字段要设置为virtual,否则出现“failed: NHibernate.InvalidProxyTypeException : The following types may not be used as proxies: NHibernateSample.Domain.Entities.Customer: method get_Id should be virtual,method set_Id should be virtual”异常。
转自:http://www.360doc.com/content/11/1102/19/1039473_161168304.shtml
其它:http://www.cyqdata.com/nhibernate/article-detail-38360