public static long Update(this IDAC dac, DataRow row) { var allColumns = row .Table .Columns .Cast <DataColumn>() .Select(c => new ColumnValue(c.ColumnName, row[c.ColumnName])); var pkCols = row .Table .PrimaryKey .Select(c => new ColumnValue(c.ColumnName, row[c.ColumnName])); return(dac.Update( row.Table.TableName, allColumns.Except(pkCols), pkCols )); }
public static long Save(this IDAC dac, DataRow dataRow, bool ommitAutoIncrementPK = true) { using (var scope = dac.BeginScope(openConnection: true)) { return(dataRow.RowState == DataRowState.Added ? dac.Insert(dataRow, ommitAutoIncrementPK) : dac.Update(dataRow)); } }
public static async Task <long> UpdateAsync(this IDAC dac, string tableName, IEnumerable <ColumnValue> setValues, IEnumerable <ColumnValue> whereValues) { return(await Task.Run(() => dac.Update(tableName, setValues, whereValues))); }
public virtual long Update(string tableName, IEnumerable <ColumnValue> setValues, IEnumerable <ColumnValue> whereValues) { return(DecoratedDAC.Update(tableName, setValues, whereValues)); }