MicroLite.Configuration.FluentConfiguration.CreateSessionFactory C# (CSharp) 메소드

CreateSessionFactory() 공개 메소드

public CreateSessionFactory ( ) : ISessionFactory
리턴 ISessionFactory
        public ISessionFactory CreateSessionFactory()
        {
            lock (locker)
            {
                var sessionFactory =
                    Configure.SessionFactories.SingleOrDefault(s => s.ConnectionName == this.chosenConnectionName);

                if (sessionFactory == null)
                {
                    if (this.log.IsDebug)
                    {
                        this.log.Debug(
                            LogMessages.FluentConfiguration_CreatingSessionFactory,
                            this.chosenConnectionName,
                            this.chosenDbDriver.GetType().Name,
                            this.chosenSqlDialect.GetType().Name);
                    }

                    sessionFactory = new SessionFactory(this.chosenConnectionName, this.chosenDbDriver, this.chosenSqlDialect);

                    if (this.sessionFactoryCreated != null)
                    {
                        sessionFactory = this.sessionFactoryCreated(sessionFactory);
                    }

                    Configure.SessionFactories.Add(sessionFactory);
                }

                return sessionFactory;
            }
        }