/// <summary> /// Checks to see if the <see cref="PersistentCollection"/> has had any changes to the /// collections contents or if any of the elements in the collection have been modified. /// </summary> /// <param name="coll"></param> /// <returns><c>true</c> if the <see cref="PersistentCollection"/> is dirty.</returns> /// <remarks> /// default behavior; will be overridden in deep lazy collections /// </remarks> private bool IsDirty( PersistentCollection coll ) { // if this has already been marked as dirty or the collection can not // be directly accessed (ie- we can guarantee that the NHibernate collection // wrappers are used) and the elements in the collection are not mutable // then return the dirty flag. if( dirty || ( !coll.IsDirectlyAccessible && !loadedPersister.ElementType.IsMutable ) ) { return dirty; } else { // need to have the coll determine if it is the same as the snapshot // that was last taken. return !coll.EqualsSnapshot( loadedPersister.ElementType ); } }