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#
Entity FindOne(
	Type entityType,
	QueryExpression queryExpression
)
Visual Basic (Declaration)
Function FindOne ( _
	entityType As Type, _
	queryExpression As QueryExpression _
) As Entity

Parameters

entityType
Type: System..::.Type
The entity type.
queryExpression
Type: Mindscape.LightSpeed.Querying..::.QueryExpression
A QueryExpression used to match the Entity that should be returned.

Return Value

A single Entity that satisfies the supplied QueryExpression.

Examples

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

See Also