Partager via


QueryBuilder.Find<'T,'Q> Method (F#)

A query operator that selects the first element selected so far that satisfies a specified condition.

Namespace/Module Path: Microsoft.FSharp.Linq

Assembly: FSharp.Core (in FSharp.Core.dll)

// Signature:
member this.Find : QuerySource<'T,'Q> * ('T -> bool) -> 'T

// Usage:
queryBuilder.Find (source, predicate)

Parameters

  • source
    Type: QuerySource<'T,'Q>

    The input query.

  • predicate
    Type: 'T -> bool

    A function that tests each element.

Exceptions

Exception

Condition

InvalidOperationException

Thrown when no element returns true when evaluated by the predicate.

Return Value

The first element for which the Boolean function predicate returns true.

Remarks

For more information and examples, see Query Expressions (F#).

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 4.0, Portable

See Also

Reference

Linq.QueryBuilder Class (F#)

Microsoft.FSharp.Linq Namespace (F#)

Query Expressions (F#)