/// <summary> /// The configure persistence. /// </summary> /// <param name="config"> /// The config. /// </param> /// <param name="dataBindingInterceptor"> /// Interceptor to enable INPC notifications /// </param> public static void ConfigurePersistence(Configuration config, DataBindingInterceptor dataBindingInterceptor) { if (dataBindingInterceptor != null) { config.SetInterceptor(dataBindingInterceptor); } }
public void TestFixtureSetup() { log4net.Config.XmlConfigurator.Configure(); var interceptor = new DataBindingInterceptor(); config = new Configuration(); config.SetInterceptor(interceptor); config.Properties[Environment.CollectionTypeFactoryClass] = typeof(ObservableCollectionTypeFactory).AssemblyQualifiedName; config.Properties[Environment.CurrentSessionContextClass] = "thread_static"; config.SetListener(global::NHibernate.Event.ListenerType.PostInsert, SaveNotificationEventListener.Instance); config.SetListener(global::NHibernate.Event.ListenerType.PostUpdate, SaveNotificationEventListener.Instance); config.Configure(); sessions = (ISessionFactoryImplementor)config.BuildSessionFactory(); interceptor.SessionFactory = sessions; provider = new NHibernateGraphTypeProvider(string.Empty, new Type[] { typeof(Request), typeof(Priority), typeof(User), typeof(Category) }); provider.SessionFactory = sessions; CurrentSessionContext.Bind(sessions.OpenSession()); }