title: No Persister for: error on save with INotifyPropertyChanged Interceptor
body: <p>Using the method described in <a href="http://ayende.com/Blog/archive/2009/08/07/nhibernate-amp-inotifypropertychanged.aspx" rel="nofollow noreferrer">NHibernate &amp; INotifyPropertyChanged</a>, the repository will return a collection of proxies that implement INotifyPropertyChanged, but on some objects when saving or deleting it will throw an error:</p>
  
  <pre><code>   at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName)
     at NHibernate.Impl.SessionImpl.GetEntityPersister(String entityName, Object obj)
     at NHibernate.Engine.ForeignKeys.IsTransient(String entityName, Object entity, Nullable`1 assumed, ISessionImplementor session)
     at NHibernate.Event.Default.AbstractSaveEventListener.GetEntityState(Object entity, String entityName, EntityEntry entry, ISessionImplementor source)
     at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event)
     at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
     at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
     at NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
     at MyCode ...
  </code></pre>
  
  <p>I figured out that if I create the session without the interceptor the SaveOrUpdate works fine, but with the interceptor it errors.</p>
  
  <p>with the interceptor:</p>
  
  <pre><code> public ISession GetSession(ISessionFactory factory)
          {
              IInterceptor dataBinding = new DataBindingInterceptor {SessionFactory = factory};
              return factory.OpenSession(dataBinding);
          }
  </code></pre>
  
  <p>without</p>
  
  <pre><code> public ISession GetSession(ISessionFactory factory)
          {
              return factory.OpenSession();
          }
  </code></pre>
  
  <p>I'm at a loss for how to go about even figuring out why the interceptor would break the save.</p>
  
  <p>The only change I made to the code was changing the line</p>
  
  <p>Type type = Type.GetType(clazz);</p>
  
  <p>to</p>
  
  <p>Type type = FindType(clazz);</p>
  
  <pre><code>public Type FindType(string typeName)
  {
      foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
      {
          Type foundType = assembly.GetType(typeName);
  
          if (foundType != null)
              return foundType;
      }
      return null;
  }
  </code></pre>