示例#1
0
        public void RegisterBuildListener(ISessionFactoryBuildListener builderListener)
        {
            if (builderListener == null)
            {
                throw Error.ArgumentNull("builderListener");
            }

            BuildListeners.Add(builderListener);
        }
        /// <summary>
        /// Initialises the N hibernate with.
        /// </summary>
        /// <param name="sessionFactoryBuildListeners">The fluent session factory build listeners.</param>
        /// <param name="connectionString">The connection string.</param>
        /// <returns></returns>
        public ISessionFactoryManager InitialiseNHibernateWith(ISessionFactoryBuildListener[] sessionFactoryBuildListeners, string connectionString)
        {
            CreateTestDatabase(connectionString);

            return new SingleSessionFactoryManager(sessionFactoryBuildListeners.Union(new [] { new MySqlSessionFactoryBuildListener() }), connectionString);
        }
示例#3
0
        protected ISessionFactoryManager InitialiseNHibernateWith(ISessionFactoryBuildListener[] sessionFactoryBuildListeners, string connectionString)
        {
            NHProfiler.NHProfiler.Enable();

            return NHibernateDatabaseTestProvider.InitialiseNHibernateWith(sessionFactoryBuildListeners, connectionString);
        }
示例#4
0
        protected ISessionFactoryManager InitialiseNHibernateWith(ISessionFactoryBuildListener[] sessionFactoryBuildListeners)
        {
            string connectionString = string.Format(ConfigurationManager.ConnectionStrings[DefaultConnectionStringName].ConnectionString, Guid.NewGuid());

            return InitialiseNHibernateWith(sessionFactoryBuildListeners, connectionString);
        }