public void InsertFact()
        {
            var connection  = default(DbConnection);
            var transaction = default(DbTransaction);

            try
            {
                connection = this._factory.CreateConnection();
                connection.Open();

                transaction = connection.BeginTransaction(IsolationLevel.Serializable);

                var entity = new TableEntity()
                {
                };
                int affected;
                var result = TableGateway.Insert(entity, connection, transaction, out affected);
            }
            finally
            {
                if (transaction != null)
                {
                    transaction.Rollback();
                }
                if (connection != null)
                {
                    connection.Close();
                }
            }
        }
示例#2
0
 public SqlServerGateway(IAppLogger <SqlServerGateway> logger)
 {
     Guard.Against.Null(logger, nameof(logger));
     _logger         = logger;
     _catalogGateway = new CatalogGateway(this);
     _tableGateway   = new TableGateway(this);
     _columnGateway  = new ColumnGateway(this);
     _serverGateway  = new ServerGateway(this);
     _domainGateway  = new DomainGateway(this);
 }