EntityConnectionExtensions.TryFirst<TRow> method (1 of 2)

namespace: Serenity.Data   assemblySerenity.Net.Entity

Tries to finds first entity, allowing the caller to set criteria and fields to select through an editQuery callback.

public static TRow TryFirst<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, or null if not found.

See Also


EntityConnectionExtensions.TryFirst<TRow> method (2 of 2)

namespace: Serenity.Data   assemblySerenity.Net.Entity

Tries to find first entity matching a where criteria.

public static TRow TryFirst<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 or null if not found.

See Also