/// <summary> /// Creates a new SqlUpdate query.</summary> /// <param name="row"> /// Row with field values to set in new record (must be in TrackAssignments mode).</param> public static SqlUpdate ToSqlUpdateById(this IIdRow row) { if (row == null) { throw new ArgumentNullException("row"); } var update = new SqlUpdate(row.Table); update.Set((Row)row, (Field)(row.IdField)); update.Where(new Criteria((Field)row.IdField) == row.IdField[(Row)row].Value); return(update); }
/// <summary> /// Creates a new SqlUpdate query.</summary> /// <param name="row"> /// Row with field values to set in new record (must be in TrackAssignments mode).</param> public static SqlUpdate ToSqlUpdateById(this IIdRow row) { if (row == null) { throw new ArgumentNullException("row"); } var update = new SqlUpdate(row.Table); var idField = row.IdField; update.Set(row, idField); update.Where(idField == new ValueCriteria(idField.AsSqlValue(row))); return(update); }
/// <summary> /// Creates a new SqlUpdate query.</summary> /// <param name="row"> /// Row with field values to set in new record (must be in TrackAssignments mode).</param> public static SqlUpdate ToSqlUpdateById(this IIdRow row, ISqlDialect dialect) { if (row == null) { throw new ArgumentNullException("row"); } var update = new SqlUpdate(dialect, row.Table, string.Empty); update.Set((Row)row, (Field)(row.IdField)); var idField = (Field)row.IdField; update.Where(idField == new ValueCriteria(idField.AsObject((Row)row))); return(update); }