-
Notifications
You must be signed in to change notification settings - Fork 0
TQueryLinqExtensions_SingleOrDefault_YlU+Mp75yor3o4POgnNEZQ
Jacob Spitzer edited this page Aug 28, 2022
·
2 revisions
Returning the only record of the TQuery recordset that satisfies a specified condition, or NULL if no such record is found, and throws an exception if there is not exactly one record that satisfies the predicate function.
public static Table SingleOrDefault<Table>(this DbEasyConnect.DbEc<Table> tQuery, System.Linq.Expressions.Expression<System.Func<Table,bool>> predicate);
Table
The type of the records of table class. need to be a class with the [Table("")] attribute.
tQuery
DbEasyConnect.DbEc<Table>
An DbEc<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.
Table
NULL if TQuery recordset is empty or if no record passes the test specified
by predicate; otherwise, the single record in TQuery recordset that passes the test specified
by predicate.