You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a domain model where PKs are not always of the same type, a fairly complex architecture of interfaces and classes is defined.
Said architecture provide for:
a IEntity defining a object Id { get; } property
a IEntity<T> : IEntity defining a new T Id { get; } property
Hence, every domain object has to implement both:
a object IEntity.Id { get { return Id; } }
and a public virtual T Id { get; }
To make things even more complicated, some entities has lazy fields on them and a IPostLoadEventListener is used.
Problem is: all this machinery functioned pretty well... up until the latest release of NHibernate.
In 5.1, for all entities with lazies, when trying to access the aforementioned Id property inside of the IPostLoadEventListener, a StackOverflowException is thrown.
Please note that all three elements above are needed for the bug to trigger.