在 nhibernate,如果将实体的一个关联属性配置为 lazy="no-proxy",那么,从其他属性计算出来的属性不能正确更新.例如,将以下代码中 Foo.Bar 配置为 lazy="no-proxy" ,属性 c 不能正确持久化. public class Foo { public virtual Bar Bar { get; set; } public virtual int a { get; set; } public virtual int b { g…
如果你曾经用过NHibernate 2.0或者更高的版本,那您一定碰到过下面的错误:NHibernate.InvalidProxyTypeException: The following types may not be used as proxies: NHibernateExamples.Entities.OrderLine: method get_UnitPrice should be 'public/protected virtual' or 'protected internal vi…