public AuditedDbDataAdapter(IDbDataAdapter wrappedAdapter, ISqlAuditor auditor = null) { if (wrappedAdapter == null) { throw new ArgumentNullException("wrappedAdapter"); } _adapter = wrappedAdapter; _auditor = auditor ?? SqlAuditor.Current; }
public AuditedDbDataReader(DbDataReader reader, DbConnection connection, ISqlAuditor auditor) { _reader = reader; _connection = connection; if (auditor != null) { _auditor = auditor; } }
public static void Initialize(ISqlAuditor auditor, bool applyEFHack, bool supportExplicitConnectionStrings) { SqlAuditor.SetCurrentAuditor(auditor); if (supportExplicitConnectionStrings && (applyEFHack || IsEF41HackRequired())) { EFProviderUtilities.UseEF41Hack(); } InitializeDbProviderFactories(); }
protected override void Dispose(bool disposing) { if (disposing && _connection != null) { _connection.StateChange -= StateChangeHandler; _connection.Dispose(); } _connection = null; _auditor = null; base.Dispose(disposing); }
public AuditedDbCommand(DbCommand command, DbConnection connection, ISqlAuditor auditor) { if (command == null) { throw new ArgumentNullException("command"); } _command = command; _connection = connection; if (auditor != null) { _auditor = auditor; } }
public AuditedDbConnection(DbConnection connection, ISqlAuditor auditor) { if (connection == null) { throw new ArgumentNullException("connection"); } _connection = connection; _connection.StateChange += StateChangeHandler; if (auditor != null) { _auditor = auditor; } }
public static void Initialize(ISqlAuditor auditor, bool supportExplicitConnectionStrings = true) { Initialize(auditor, false, supportExplicitConnectionStrings); }
public AuditedDbProviderServices(DbProviderServices tail, ISqlAuditor auditor) { this._wrapped = tail; this._auditor = auditor; }
public EFAuditedDbConnection(DbConnection connection, ISqlAuditor auditor) : base(connection, auditor) { }
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; }