|
I don't know why you would want an entity class to expose another entity as a static property, but in any case, you would have to load these static properties in the class's static constructor. I don't see how NHibernate is going to know to load (or save) them, as they are static. Being static, they are not associated with any particular instance.
Let's take the example of an ApplicationUser entity class. Rather than expose the application's currently logged in user as a static property on the ApplicationUser entity class, it should be exposed as an instance property on a separate singleton class, say ApplicationSession.
|