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
Syntaxpublic DomainObject FindFirstOrDefault(
Repository repository,
Expression<Func<DomainObject, bool>> predicate
)
Public Function FindFirstOrDefault (
repository As Repository,
predicate As Expression(Of Func(Of DomainObject, Boolean))
) As DomainObject
public:
DomainObject^ FindFirstOrDefault(
Repository^ repository,
Expression<Func<DomainObject^, bool>^>^ predicate
)
member FindFirstOrDefault :
repository : Repository *
predicate : Expression<Func<DomainObject, bool>> -> DomainObject
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