nhibernate/nhibernate-core — pull request #36 by ramonsmits (2011-12-19 12:36:28+00:00)
Title: SimpleExpression.ToString() can result in unwanted loading of lazy objects

SimpleExpression.ToString() can result in unwanted loading of lazy objects. This is because it called value.ToString() to get a string representation of an entity. The entity ToString() can access lazy loaded properties thus in unwanted loading of entities.

Code changed so that the string value is retrieved via ObjectUtils. The implementation of ObjectUtils now checks if the supplied instance implements INHibernateProxy and used that to return an identification without calling .ToString().