Where() public method

Adds conditions to WHERE clause of the query.
public Where ( ) : SqlUpdate
return SqlUpdate
Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        /// <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);
        }