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); }
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); }