How do I get the entity type on an object that may be a NHibernate proxy object?

后端 未结 4 847
独厮守ぢ
独厮守ぢ 2021-02-19 04:21

I have a base class DomainObject for all my business objects I am using with NHibernate. It contains the Id property.

public abstract          


        
4条回答
  •  执笔经年
    2021-02-19 05:11

    To get real object instead of proxy you can use

    session.PersistenceContext.Unproxy(proxyObject)
    

    But I think you should look at Sharp architecture implementation for Equals.

提交回复
热议问题