示例#1
0
        public static async Task <T> ExecuteScalar <T>(IConnectionInfoAsync connectionInfo, string sql,
                                                       Action <MySqlParameterCollection> addParameters, Func <object, T> factory = null)
        {
            string connectionString = await connectionInfo.GetConnectionStringAsync();

            return(await ExecuteScalar(connectionString, sql, addParameters, factory));
        }
示例#2
0
        public static async Task <List <T> > ExecuteReaderListResult <T>(IConnectionInfoAsync connectionInfo, string sql,
                                                                         Action <MySqlParameterCollection> addParameters, Func <DbDataReader, T> factory)
        {
            string connectionString = await connectionInfo.GetConnectionStringAsync();

            return(await ExecuteReaderListResult(connectionString, sql, addParameters, factory));
        }
示例#3
0
        public static async Task <T> ExecuteReader <T>(IConnectionInfoAsync connectionInfo, string sql,
                                                       Action <MySqlParameterCollection> addParameters, Func <DbDataReader, Task <T> > factory) where T : class
        {
            string connectionString = await connectionInfo.GetConnectionStringAsync();

            return(await ExecuteReader(connectionString, sql, addParameters, factory));
        }
        public void SetUp()
        {
            _parameterStoreRequest = A.Fake <IParameterStoreRequest>();
            IConnectionInfo connectionInfo = new StringConnectionInfo(_connectionString);

            _connectionInfoAsync = new ConnectionInfoAsync(_parameterStoreRequest, connectionInfo);
        }
示例#5
0
 public DomainTlsSecurityProfileDao(IConnectionInfoAsync connectionInfo,
                                    IMxSecurityTesterConfig mxSecurityTesterConfig,
                                    ILogger log)
 {
     _connectionInfo         = connectionInfo;
     _mxSecurityTesterConfig = mxSecurityTesterConfig;
     _log = log;
 }
示例#6
0
 public static async Task <T> ExecuteScalarTimed <T>(IConnectionInfoAsync connectionInfo, string sql,
                                                     Action <MySqlParameterCollection> addParameters, Func <object, T> factory, Action <string> log, string callName)
 {
     using (Timer timer = new Timer(log, callName))
     {
         return(await ExecuteScalar(connectionInfo, sql, addParameters, factory));
     }
 }
示例#7
0
 public static Task <T> ExecuteReaderTimed <T>(IConnectionInfoAsync connectionInfo,
                                               string sql, Action <MySqlParameterCollection> addParameters, Func <DbDataReader, Task <T> > factory,
                                               Action <string> log, string callName) where T : class
 {
     using (Timer timer = new Timer(log, callName))
     {
         return(ExecuteReader(connectionInfo, sql, addParameters, factory));
     }
 }
示例#8
0
 internal MxEntityDao(
     IConnectionInfoAsync connectionInfo,
     ILogger <MxEntityDao> log,
     Func <string, IDictionary <string, object>, Task <int> > saveOperation
     )
 {
     _connectionInfo = connectionInfo;
     _log            = log;
     _saveOperation  = saveOperation ?? DefaultSaveToDatabase;
 }
        protected override void SetUp()
        {
            base.SetUp();

            IConnectionInfoAsync connectionInfoAsync = A.Fake <IConnectionInfoAsync>();

            _spfConfigReadModelDao = new SpfConfigReadModelDao(connectionInfoAsync, A.Fake <ILogger>());

            A.CallTo(() => connectionInfoAsync.GetConnectionStringAsync()).Returns(Task.FromResult(ConnectionString));
        }
示例#10
0
        protected override void SetUp()
        {
            base.SetUp();

            IConnectionInfoAsync connectionInfo = A.Fake <IConnectionInfoAsync>();

            _groupDao = new GroupDao(connectionInfo);

            A.CallTo(() => connectionInfo.GetConnectionStringAsync()).Returns(ConnectionString);
        }
示例#11
0
        protected override void SetUp()
        {
            base.SetUp();

            _connectionInfoAsync  = A.Fake <IConnectionInfoAsync>();
            _recordImporterConfig = A.Fake <IRecordImporterConfig>();
            _dmarcRecordDao       = new DmarcRecordDao(_connectionInfoAsync, _recordImporterConfig, A.Fake <ILogger>());

            A.CallTo(() => _connectionInfoAsync.GetConnectionStringAsync()).Returns(Task.FromResult(ConnectionString));
        }
示例#12
0
        protected override void SetUp()
        {
            base.SetUp();

            IConnectionInfoAsync connectionInfoAsync = A.Fake <IConnectionInfoAsync>();

            A.CallTo(() => connectionInfoAsync.GetConnectionStringAsync()).Returns(ConnectionString);

            _dao = new TlsRptEntityDao(connectionInfoAsync);
        }
示例#13
0
 public DmarcRecordDao(IConnectionInfoAsync connectionInfo,
                       IRecordImporterConfig recordImporterConfig,
                       ILogger log) : base(connectionInfo,
                                           recordImporterConfig,
                                           log,
                                           DmarcRecordDaoResources.SelectDomainsWithRecords,
                                           DmarcRecordDaoResources.InsertRecord,
                                           DmarcRecordDaoResources.InsertRecordValueFormatString,
                                           DmarcRecordDaoResources.InsertRecordOnDuplicateKey)
 {
 }
示例#14
0
        public static async Task <List <T> > ExecuteReaderListResultTimed <T>(IConnectionInfoAsync connectionInfo,
                                                                              string sql, Action <MySqlParameterCollection> addParameters, Func <DbDataReader, T> factory,
                                                                              Action <string> log, string callName)
        {
            using (Timer timer = new Timer(log, callName))
            {
                string connectionString = await connectionInfo.GetConnectionStringAsync();

                return(await ExecuteReaderListResult(connectionString, sql, addParameters, factory));
            }
        }
示例#15
0
        protected override void SetUp()
        {
            base.SetUp();

            TruncateDatabase().Wait();

            IConnectionInfoAsync connectionInfo = A.Fake <IConnectionInfoAsync>();

            A.CallTo(() => connectionInfo.GetConnectionStringAsync()).Returns(ConnectionString);

            _dao = new SpfSchedulerDao(connectionInfo);
        }
示例#16
0
        protected override void SetUp()
        {
            base.SetUp();

            _connectionInfoAsync = A.Fake <IConnectionInfoAsync>();

            _config = A.Fake <IDkimSchedulerConfig>();

            A.CallTo(() => _config.RefreshIntervalSeconds).Returns(86400);
            A.CallTo(() => _config.DomainsLimit).Returns(10);
            A.CallTo(() => _connectionInfoAsync.GetConnectionStringAsync()).Returns(ConnectionString);

            _dkimSchedulerDao =
                new DkimSchedulerDao(_connectionInfoAsync);
        }
示例#17
0
 protected DnsRecordDao(IConnectionInfoAsync connectionInfoAsync,
                        IRecordImporterConfig recordImporterConfig,
                        ILogger log,
                        string selectDomainsWithRecords,
                        string insertRecord,
                        string insertRecordValueFormatString,
                        string insertRecordOnDuplicateKey)
 {
     _connectionInfoAsync  = connectionInfoAsync;
     _recordImporterConfig = recordImporterConfig;
     _log = log;
     _selectDomainsWithRecords      = selectDomainsWithRecords;
     _insertRecord                  = insertRecord;
     _insertRecordValueFormatString = insertRecordValueFormatString;
     _insertRecordOnDuplicateKey    = insertRecordOnDuplicateKey;
 }
示例#18
0
        protected override void SetUp()
        {
            base.SetUp();

            TruncateDatabase().Wait();

            IConnectionInfoAsync connectionInfoAsync = A.Fake <IConnectionInfoAsync>();

            A.CallTo(() => connectionInfoAsync.GetConnectionStringAsync()).Returns(ConnectionString);

            ISpfPeriodicSchedulerConfig config = A.Fake <ISpfPeriodicSchedulerConfig>();

            A.CallTo(() => config.RefreshIntervalSeconds).Returns(0);
            A.CallTo(() => config.DomainBatchSize).Returns(10);

            _dao = new SpfPeriodicSchedulerDao(connectionInfoAsync, config);
        }
示例#19
0
 public TlsRptPeriodicSchedulerDao(IConnectionInfoAsync connectionInfo, ITlsRptPeriodicSchedulerConfig config)
 {
     _connectionInfo = connectionInfo;
     _config         = config;
 }
 public DkimApiApiDao(IConnectionInfoAsync connectionInfoAsync)
 {
     _connectionInfo = connectionInfoAsync;
 }
示例#21
0
 public DkimHistoryEntityDao(IConnectionInfoAsync connectionInfoAsync)
 {
     _connectionInfoAsync = connectionInfoAsync;
 }
示例#22
0
 public SpfApiDao(IConnectionInfoAsync connectionInfo)
 {
     _connectionInfo = connectionInfo;
 }
 public MetricsDao(IConnectionInfoAsync connectionInfo)
 {
     _connectionInfo = connectionInfo;
 }
 public TlsEntityDao(IConnectionInfoAsync connectionInfo)
 {
     _connectionInfo = connectionInfo;
 }
 public Ip6ToAsnDao(IConnectionInfoAsync connectionInfo, ILogger <IpToAsnDao> log) : base(connectionInfo, log)
 {
 }
 public PermissionDao(IConnectionInfoAsync connectionInfo, ILogger <IPermissionDao> log)
 {
     _connectionInfo = connectionInfo;
     _log            = log;
 }
示例#27
0
 public GroupDao(IConnectionInfoAsync connectionInfo)
 {
     _connectionInfo = connectionInfo;
 }
 public MxApiDao(IConnectionInfoAsync connectionInfo, ILogger <MxApiDao> log)
 {
     _connectionInfo = connectionInfo;
     _log            = log;
 }
示例#29
0
 public AsDao(IConnectionInfoAsync connectionInfo, ILogger <IAsnDao> log)
 {
     _connectionInfo = connectionInfo;
     _log            = log;
 }
示例#30
0
 public IpAddressDetailsDao(IConnectionInfoAsync connectionInfo, ILogger <IpAddressDetailsDao> log)
 {
     _connectionInfo = connectionInfo;
     _log            = log;
 }