Skip to content

TQueryLinqExtensions_Single_bY4d6dq6kTs2ewmGc2EbxQ

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

TQueryLinqExtensions.Single<Table>(DbEcExtended<Table>, Expression<Func<Table,bool>>) Method

Returning the only record of the TQuery recordset that satisfies a specified condition, and throws an exception if there is not exactly one record that satisfies the predicate function.

public static Table Single<Table>(this DbEasyConnect.DbEcExtended<Table> tQuery, System.Linq.Expressions.Expression<System.Func<Table,bool>> predicate);

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 apply the predicate to.

predicate System.Linq.Expressions.Expression<System.Func<Table,System.Boolean>>
A function to test each record for a condition.

Returns

Table
The single record in the TQuery recordset that passes the test in the specified predicate function.

Clone this wiki locally