Example #1
0
 protected Database(string connectionString, System.Data.Common.DbProviderFactory dbProviderFactory)
 {
     if (string.IsNullOrEmpty(connectionString))
     {
         throw new ArgumentException(Resources.ExceptionNullOrEmptyString, "connectionString");
     }
     if (dbProviderFactory == null)
     {
         throw new ArgumentNullException("dbProviderFactory");
     }
     this.connectionString = new Microsoft.Practices.EnterpriseLibrary.Data.ConnectionString(connectionString, VALID_USER_ID_TOKENS, VALID_PASSWORD_TOKENS);
     this.dbProviderFactory = dbProviderFactory;
     this.instrumentationProvider = new DataInstrumentationProvider();
 }
Example #2
0
 protected Database(
     string connectionString,
     DbProviderFactory dbProviderFactory,
     IDataInstrumentationProvider instrumentationProvider)
 {
     if (string.IsNullOrEmpty(connectionString))
     {
         throw new ArgumentException(Resources.ExceptionNullOrEmptyString, nameof(connectionString));
     }
     if (dbProviderFactory == null)
     {
         throw new ArgumentNullException(nameof(dbProviderFactory));
     }
     if (instrumentationProvider == null)
     {
         throw new ArgumentNullException(nameof(instrumentationProvider));
     }
     this.connectionString        = new Microsoft.Practices.EnterpriseLibrary.Data.ConnectionString(connectionString, Database.VALID_USER_ID_TOKENS, Database.VALID_PASSWORD_TOKENS);
     this.dbProviderFactory       = dbProviderFactory;
     this.instrumentationProvider = instrumentationProvider;
 }