EntityConnectionExtensions.First<TRow> method (1 of 2)
namespace: Serenity.Data assembly: Serenity.Net.Entity
Finds first entity, allowing the caller to set criteria and fields to select through an editQuery callback.
public static TRow First<TRow>(this IDbConnection connection, Action<SqlQuery> editQuery)
where TRow : class, IRow, new()
parameter | description |
---|---|
TRow | The type of the row. |
connection | The connection. |
editQuery | The edit query callback. |
Return Value
First entity matching the criteria.
Exceptions
exception | condition |
---|---|
ValidationError | No records matching the specified criteria. |
See Also
- class TRow
- class SqlQuery
- interface IRow
- class EntityConnectionExtensions
EntityConnectionExtensions.First<TRow> method (2 of 2)
namespace: Serenity.Data assembly: Serenity.Net.Entity
Finds first entity matching a where criteria.
public static TRow First<TRow>(this IDbConnection connection, ICriteria where)
where TRow : class, IRow, new()
parameter | description |
---|---|
TRow | The type of the row. |
connection | The connection. |
where | The where criteria. |
Return Value
First entity matching the where criteria.
Exceptions
exception | condition |
---|---|
ValidationError | No records matching the specified criteria. |
See Also
- class TRow
- interface ICriteria
- interface IRow
- class EntityConnectionExtensions