Finds a single Entity that satisfies the provided QueryExpression.

Namespace:  Mindscape.LightSpeed
Assembly:  Mindscape.LightSpeed (in Mindscape.LightSpeed.dll)
Version: 4.0.0.0 (4.0.0.0)

Syntax

C#
TEntity FindOne<TEntity>(
	QueryExpression queryExpression
) where TEntity : Entity
Visual Basic (Declaration)
Function FindOne(Of TEntity As Entity) ( _
	queryExpression As QueryExpression _
) As TEntity

Parameters

queryExpression
Type: Mindscape.LightSpeed.Querying..::.QueryExpression
A QueryExpression used to match the Entity that should be returned.

Type Parameters

TEntity
The entity type.

Return Value

A single Entity that satisfies the supplied QueryExpression.

Examples

CopyC#
Customer customer = unitOfWork.FindOne<Customer>(Entity.Attribute("AccountNo") == "ABC123");

See Also