コード例 #1
0
        public SQLServerStorage(IOptions <SQLServerStorageOptions> options, SQLServerConnectionFactory connectionFactory, ILogger <SQLServerStorage> logger)
        {
            _options = options.Value;

            ConnectionFactory = connectionFactory;
            Logger            = logger;

            if (_options.EnableDefer)
            {
                _deferFlushCollection = new AsyncCallbackDeferFlushCollection <IRequestInfo, IRequestDetail>(AddRequestInfoAsync, _options.DeferThreshold, _options.DeferSecond);
            }
        }
コード例 #2
0
        public SQLServerStorage(IOptions <SQLServerStorageOptions> options, SQLServerConnectionFactory connectionFactory, ILogger <SQLServerStorage> logger)
        {
            _options = options.Value;
            if (!_options.TablePrefix.IsEmpty())
            {
                Prefix = _options.TablePrefix + ".";
            }
            ConnectionFactory = connectionFactory;
            Logger            = logger;

            if (_options.EnableDefer)
            {
                _deferFlushCollection = new AsyncCallbackDeferFlushCollection <RequestBag>(AddRequestInfoAsync, _options.DeferThreshold, _options.DeferSecond);
            }
        }
コード例 #3
0
        public SQLServerStorage(IOptions <SQLServerStorageOptions> options, ILogger <SQLServerStorage> logger)

            : base(new BaseStorageOptions
        {
            DeferSecond      = options.Value.DeferSecond,
            DeferThreshold   = options.Value.DeferThreshold,
            ConnectionString = options.Value.ConnectionString,
            DataType         = FreeSql.DataType.SqlServer
        })

        {
            _options = options.Value;

            Logger = logger;
        }
コード例 #4
0
        public SQLServerStorage(IOptions <SQLServerStorageOptions> options, SQLServerConnectionFactory connectionFactory, ILogger <SQLServerStorage> logger)

            : base(new BaseStorageOptions
        {
            DeferSecond      = options.Value.DeferSecond,
            DeferThreshold   = options.Value.DeferThreshold,
            ConnectionString = options.Value.ConnectionString,
            DataType         = FreeSql.DataType.SqlServer
        })

        {
            _options = options.Value;

            if (!_options.TablePrefix.IsEmpty())
            {
                Prefix = _options.TablePrefix + ".";
            }
            ConnectionFactory = connectionFactory;
            Logger            = logger;
        }