Exemplo n.º 1
0
        public FluentCommandBuilder(DbConnection cnx, IGenerateSql <T> sqlGen, Action <DbCommand> cfg, CancellationToken?cancel)
        {
            _cnx    = cnx;
            _cancel = cancel ?? CancellationToken.None;

            var cmdConfig = sqlGen.GetCommandConfiguration();

            cmdConfig.ApplyOptions = cfg;
            _cmd = cnx.CreateAndSetupCommand(cmdConfig);
        }
Exemplo n.º 2
0
        public FluentCommandExecutor(DbConnection cnx, IGenerateSql sqlGen, Action <DbCommand> cfg, bool disposeAfterQuery = false, CancellationToken?cancel = null)
        {
            _disposeAfterQuery = disposeAfterQuery;

            _cancel = cancel ?? CancellationToken.None;

            var cmdConfig = sqlGen.GetCommandConfiguration();

            cmdConfig.ApplyOptions = cfg;
            _cmd = cnx.CreateAndSetupCommand(cmdConfig);
        }