コード例 #1
0
        public ISession Create(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
        {
            var connection  = _connectionsFactory.Create();
            var transaction = connection.BeginTransaction(isolationLevel);

            return(new Session(connection, transaction));
        }
コード例 #2
0
        protected DbUsingTestBase()
        {
            _isAppVeyor = Environment.GetEnvironmentVariable("Appveyor")?.ToUpperInvariant() == "TRUE";

            ConnectionsFactory          = new SqlConnectionsFactory(ConnectionString);
            SqlConnectionsFactoryMethod = () => (SqlConnection)ConnectionsFactory.Create();
        }
コード例 #3
0
        protected DbUsingTestBase()
        {
            _isAppVeyor = Environment.GetEnvironmentVariable("Appveyor")?.ToUpperInvariant() == "TRUE";
            _isTravis   = Environment.GetEnvironmentVariable("TRAVIS")?.ToUpperInvariant() == "TRUE";

            ConnectionsFactory = new SqlConnectionsFactory(Options.Create(new SqlConnectionsFactoryOptions {
                SqlServer = ConnectionString
            }));
            SqlConnectionsFactoryMethod = () => (SqlConnection)ConnectionsFactory.Create();
        }
コード例 #4
0
        protected DbUsingTestBase()
        {
            var isAppVeyor = Environment.GetEnvironmentVariable("APPVEYOR")?.ToUpperInvariant() == "TRUE";

            _isAppVeyorWindows = isAppVeyor && Environment.GetEnvironmentVariable("CI_WINDOWS")?.ToUpperInvariant() == "TRUE";
            _isAppVeyorLinux   = isAppVeyor && Environment.GetEnvironmentVariable("CI_LINUX")?.ToUpperInvariant() == "TRUE";

            _isTravis = Environment.GetEnvironmentVariable("TRAVIS")?.ToUpperInvariant() == "TRUE";

            ConnectionsFactory = new SqlConnectionsFactory(Options.Create(new SqlConnectionsFactoryOptions {
                SqlServer = ConnectionString
            }));
            SqlConnectionsFactoryMethod = () => (SqlConnection)ConnectionsFactory.Create();
        }