Finds a single Entity that satisfies the provided QueryExpression.
Namespace:
Mindscape.LightSpeed.ServiceModelAssembly: Mindscape.LightSpeed.ServiceModel (in Mindscape.LightSpeed.ServiceModel.dll)
Version: 4.0.0.0 (4.0.0.0)
Syntax
C# |
---|
public TEntity FindOne<TEntity>( QueryExpression queryExpression ) where TEntity : Entity |
Visual Basic (Declaration) |
---|
Public 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");