Skip to content

TQueryLinqExtensions_SingleOrDefault_7_4U+m7e5t9h6tWnoAGUJQ

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

TQueryLinqExtensions.SingleOrDefault<Table>(DbEc<Table>) Method

Returning the only record of the TQuery recordset, or NULL if no such record is found, and throws an exception if there is not exactly one record.

public static Table SingleOrDefault<Table>(this DbEasyConnect.DbEc<Table> tQuery);

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

Returns

Table
NULL if TQuery recordset is empty or if no record found; otherwise, the single record in TQuery recordset.

Clone this wiki locally