public static IDataReader ExecuteReader( this IDataCommandScope scope, ISqlBuilder sqlBuilder) { return(scope.Execute((builder) => { builder.Command = scope.CreateCommand(CommandBehavior.Default); var cfg = builder.Configuration; cfg.Query = sqlBuilder; }, (builder) => builder.Command.ExecuteReader())); }
public static IDataReader ExecuteReader( this IDataCommandScope scope, ISqlBuilder sqlBuilder, IList <object> parameters) { return(scope.Execute((builder) => { builder.Command = scope.CreateCommand(); var cfg = builder.Configuration; cfg.Query = sqlBuilder; cfg.SetParameters(parameters); }, (builder) => builder.Command.ExecuteReader())); }
public static object ExecuteScalar( this IDataCommandScope scope, ISqlBuilder sqlBuilder, IEnumerable <KeyValuePair <string, object> > parameters, CommandBehavior behavior = CommandBehavior.Default) { return(scope.Execute((builder) => { builder.Command = scope.CreateCommand(behavior); var cfg = builder.Configuration; cfg.Query = sqlBuilder; cfg.SetParameters(parameters); }, (builder) => builder.Command.ExecuteScalar())); }
public static int Execute( this IDataCommandScope scope, ISqlBuilder sqlBuilder, IList <IDbDataParameter> parameters, CommandBehavior behavior = CommandBehavior.Default) { return(scope.Execute((builder) => { builder.Command = scope.CreateCommand(behavior); var cfg = builder.Configuration; cfg.Query = sqlBuilder; cfg.SetParameters(parameters); }, (builder) => builder.Command.Execute())); }