Example #1
0
 /// <summary>
 /// Initialiser method
 /// </summary>
 /// <param name="config">The fluent NHibernate configuration from which to build a session factory</param>
 /// <param name="storageType">The storage mechanism to use</param>
 public static void Initialise(FluentConfiguration config, UnitOfWorkStorageType storageType)
 {
     Initialise(config.BuildSessionFactory(), storageType);
 }
 public DatabaseModule(string filename, UnitOfWorkStorageType storage)
 {
     m_sqliteFilename = filename;
     m_storage = storage;
 }
Example #3
0
        /// <summary>
        /// Initialiser method
        /// </summary>
        /// <param name="factory">The NHibernate session factory</param>
        /// <param name="storageType">The storage mechanism to use</param>
        public static void Initialise(ISessionFactory factory, UnitOfWorkStorageType storageType)
        {
            IUnitOfWorkStorage storageObj;
            switch (storageType)
            {
                case UnitOfWorkStorageType.Simple:
                    storageObj = new SimpleSessionStorage();
                    break;
                case UnitOfWorkStorageType.Web:
                    storageObj = new WebSessionStorage();
                    break;
                default:
                    throw new ArgumentOutOfRangeException("Unknown storage type specified");
            }

            Initialise(factory, storageObj);
        }
 public StandardModule(string filename, UnitOfWorkStorageType storage)
 {
     m_sqliteFilename = filename;
     m_storage = storage;
 }