Skip to content

TQueryCrudExtensions_Update_8ptvJeu7jTSFfxPme7rmVA

Jacob Spitzer edited this page Aug 28, 2022 · 3 revisions

TQueryCrudExtensions.Update<Table>(DbEcExtended<Table>, Expression<Func<Table,Table>>) Method

Updates one or more columns on all records of the TQuery recordset to the database table by the predicate assignment(s).

public static DbEasyConnect.DbEcUpdate<Table> Update<Table>(this DbEasyConnect.DbEcExtended<Table> tQuery, System.Linq.Expressions.Expression<System.Func<Table,Table>> assignment);

Type parameters

Table
The type of the records of table class. need to be a class with the [Table("")] attribute.

Parameters

tQuery DbEasyConnect.DbEcExtended<Table>
An DbEcExtended<T> to perform the update command.

assignment System.Linq.Expressions.Expression<System.Func<Table,Table>>
The columns to be updated with their new value assignment. Example: DbEc().Update(x => new Sample { MyProperty = x.MyInteger + 5, MyString = null, MyBool = true, MyOtherString = "something" })

Returns

DbEasyConnect.DbEcUpdate<Table>
An DbEcUpdate<T> instance, which the SQL command will update records in the database, and Execute() will return the number of records updated successfully.

Clone this wiki locally