public static int Set(this IDBIO dbio, IEnumerable <string> queries, bool throwOnException = true) { return(dbio.Set(cmd => { Result <int> queryExecutionResult; int affectedRows; affectedRows = 0; foreach (string query in queries.notEmpty()) { cmd.CommandText = query; queryExecutionResult = new Result <int>(cmd.ExecuteNonQuery); if (queryExecutionResult.Ok) { affectedRows += queryExecutionResult.Value; } else if (throwOnException) { throw queryExecutionResult.Exception; } } return affectedRows; })); }
public static void Set(this IDBIO dbio, Action <IDbCommand> instructions) { dbio.Set(cmd => { instructions(cmd); return(0); }); }
private static int prv_set(IDBIO dbio, string query, IEnumerable <KeyValuePair <string, object> > parameters) { return(dbio.Set(cmd => { cmd.CommandText = query; cmd.addParameters(parameters); return cmd.ExecuteNonQuery(); })); }
public static int execute(this IDBQuery query, IDBIO db) { return(db.Set(query)); }
private void DropTableCliente(IDBIO db) { db.Set($@"DROP TABLE cliente"); }