Table of Contents

Method SingleOrDefault

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

SingleOrDefault<T>(IMappedQuery<T>)

Reads the only mapped row.

public static T? SingleOrDefault<T>(this IMappedQuery<T> query)

Parameters

query IMappedQuery<T>

The query to execute.

Returns

T

The single row, or default if the query returns no rows.

Type Parameters

T

The type each row is mapped to.

Exceptions

InvalidOperationException

The query returns more than one row.

See Also