Пример #1
0
        public AuditedDbDataAdapter(IDbDataAdapter wrappedAdapter, ISqlAuditor auditor = null)
        {
            if (wrappedAdapter == null)
            {
                throw new ArgumentNullException("wrappedAdapter");
            }

            _adapter = wrappedAdapter;
            _auditor = auditor ?? SqlAuditor.Current;
        }
Пример #2
0
        public AuditedDbDataReader(DbDataReader reader, DbConnection connection, ISqlAuditor auditor)
        {
            _reader     = reader;
            _connection = connection;

            if (auditor != null)
            {
                _auditor = auditor;
            }
        }
Пример #3
0
        public static void Initialize(ISqlAuditor auditor, bool applyEFHack, bool supportExplicitConnectionStrings)
        {
            SqlAuditor.SetCurrentAuditor(auditor);

            if (supportExplicitConnectionStrings && (applyEFHack || IsEF41HackRequired()))
            {
                EFProviderUtilities.UseEF41Hack();
            }

            InitializeDbProviderFactories();
        }
Пример #4
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && _connection != null)
            {
                _connection.StateChange -= StateChangeHandler;
                _connection.Dispose();
            }

            _connection = null;
            _auditor    = null;
            base.Dispose(disposing);
        }
Пример #5
0
        public AuditedDbCommand(DbCommand command, DbConnection connection, ISqlAuditor auditor)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            _command    = command;
            _connection = connection;

            if (auditor != null)
            {
                _auditor = auditor;
            }
        }
Пример #6
0
        public AuditedDbConnection(DbConnection connection, ISqlAuditor auditor)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            _connection              = connection;
            _connection.StateChange += StateChangeHandler;

            if (auditor != null)
            {
                _auditor = auditor;
            }
        }
Пример #7
0
 public static void Initialize(ISqlAuditor auditor, bool supportExplicitConnectionStrings = true)
 {
     Initialize(auditor, false, supportExplicitConnectionStrings);
 }
Пример #8
0
 public AuditedDbProviderServices(DbProviderServices tail, ISqlAuditor auditor)
 {
     this._wrapped = tail;
     this._auditor = auditor;
 }
Пример #9
0
 public EFAuditedDbConnection(DbConnection connection, ISqlAuditor auditor)
     : base(connection, auditor)
 {
 }
Пример #10
0
 internal static void SetCurrentAuditor(ISqlAuditor auditor)
 {
     _auditor = auditor;
 }
 /// <summary>
 /// proxy
 /// </summary>
 /// <param name="auditor"></param>
 /// <param name="tail"></param>
 public AuditedDbProviderFactory(ISqlAuditor auditor, DbProviderFactory tail)
 {
     this._auditor = auditor;
     this._tail    = tail;
 }
 /// <summary>
 /// Allow to re-init the auditor factory.
 /// </summary>
 /// <param name="auditor"> </param>
 /// <param name="tail"></param>
 public void InitProfiledDbProviderFactory(ISqlAuditor auditor, DbProviderFactory tail)
 {
     this._auditor = auditor;
     this._tail    = tail;
 }