Skip to content

TQueryCrudExtensions_Update_MMlny54ZnKx8yi2uhWw_iw

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

TQueryCrudExtensions.Update<Table>(DbEc<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 int Update<Table>(this DbEasyConnect.DbEc<Table> tQuery, System.Linq.Expressions.Expression<System.Func<Table,Table>> expression);

Type parameters

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

Parameters

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

expression 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

System.Int32
The number of records updated successfully.

Clone this wiki locally