示例#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);
            }
        }
        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;
        }