Click or drag to resize

ObjectTransactionFindFirstOrDefault Method (Repository, ExpressionFuncDomainObject, Boolean)

Searches through both committed and uncommitted objects for a single object, matching the predicate. Returns null if not found. This variant

Namespace:  Aloe.SystemFrameworks.Domain
Assembly:  Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntax
public DomainObject FindFirstOrDefault(
	Repository repository,
	Expression<Func<DomainObject, bool>> predicate
)

Parameters

repository
Type: Aloe.SystemFrameworks.DomainRepository
The repository to search.
predicate
Type: System.Linq.ExpressionsExpressionFuncDomainObject, Boolean
The predicate to match.

Return Value

Type: DomainObject
The found object or null.
Remarks
Because it knows, that it has to find only a single object, the method searches first locally and queries the data source only if no object is found locally.
See Also