Linq.QueryBuilder Class (F#)

The type used to support the F# query syntax.

Namespace/Module Path: Microsoft.FSharp.Linq

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

type QueryBuilder =
 class
  new QueryBuilder : unit -> QueryBuilder
  member this.All : QuerySource<'T,'Q> * ('T -> bool) -> bool
  member this.AverageBy : QuerySource<'T,'Q> * ('T -> ^Value) -> ^Value
  member this.AverageByNullable : QuerySource<'T,'Q> * ('T -> Nullable<^Value>) -> Nullable<^Value>
  member this.Contains : QuerySource<'T,'Q> * 'T -> bool
  member this.Count : QuerySource<'T,'Q> -> int
  member this.Distinct : QuerySource<'T,'Q> -> QuerySource<'T,'Q>
  member this.ExactlyOne : QuerySource<'T,'Q> -> 'T
  member this.ExactlyOneOrDefault : QuerySource<'T,'Q> -> 'T
  member this.Exists : QuerySource<'T,'Q> * ('T -> bool) -> bool
  member this.Find : QuerySource<'T,'Q> * ('T -> bool) -> 'T
  member this.For : QuerySource<'T,'Q> * ('T -> QuerySource<'Result,'Q2>) -> QuerySource<'Result,'Q>
  member this.GroupBy : QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<IGrouping<'Key,'T>,'Q>
  member this.GroupJoin : QuerySource<'Outer,'Q> * QuerySource<'Inner,'Q> * ('Outer -> 'Key) * ('Inner -> 'Key) * ('Outer -> seq<'Inner> -> 'Result) -> QuerySource<'Result,'Q>
  member this.GroupValBy : QuerySource<'T,'Q> * ('T -> 'Value) * ('T -> 'Key) -> QuerySource<IGrouping<'Key,'Value>,'Q>
  member this.Head : QuerySource<'T,'Q> -> 'T
  member this.HeadOrDefault : QuerySource<'T,'Q> -> 'T
  member this.Join : QuerySource<'Outer,'Q> * QuerySource<'Inner,'Q> * ('Outer -> 'Key) * ('Inner -> 'Key) * ('Outer -> 'Inner -> 'Result) -> QuerySource<'Result,'Q>
  member this.Last : QuerySource<'T,'Q> -> 'T
  member this.LastOrDefault : QuerySource<'T,'Q> -> 'T
  member this.LeftOuterJoin : QuerySource<'Outer,'Q> * QuerySource<'Inner,'Q> * ('Outer -> 'Key) * ('Inner -> 'Key) * ('Outer -> seq<'Inner> -> 'Result) -> QuerySource<'Result,'Q>
  member this.MaxBy : QuerySource<'T,'Q> * ('T -> 'Value) -> 'Value
  member this.MaxByNullable : QuerySource<'T,'Q> * ('T -> Nullable<'Value>) -> Nullable<'Value>
  member this.MinBy : QuerySource<'T,'Q> * ('T -> 'Value) -> 'Value
  member this.MinByNullable : QuerySource<'T,'Q> * ('T -> Nullable<'Value>) -> Nullable<'Value>
  member this.Nth : QuerySource<'T,'Q> * int -> 'T
  member this.Quote : Expr<'T> -> Expr<'T>
  member this.Run : Expr<QuerySource<'T,IQueryable>> -> IQueryable<'T>
  member this.Select : QuerySource<'T,'Q> * ('T -> 'Result) -> QuerySource<'Result,'Q>
  member this.Skip : QuerySource<'T,'Q> * int -> QuerySource<'T,'Q>
  member this.SkipWhile : QuerySource<'T,'Q> * ('T -> bool) -> QuerySource<'T,'Q>
  member this.SortBy : QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>
  member this.SortByDescending : QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>
  member this.SortByNullable : QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>
  member this.SortByNullableDescending : QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>
  member this.Source : IEnumerable<'T> -> QuerySource<'T,IEnumerable>
  member this.Source : IQueryable<'T> -> QuerySource<'T,'Q>
  member this.SumBy : QuerySource<'T,'Q> * ('T -> ^Value) -> ^Value
  member this.SumByNullable : QuerySource<'T,'Q> * ('T -> Nullable<^Value>) -> Nullable<^Value>
  member this.Take : QuerySource<'T,'Q> * int -> QuerySource<'T,'Q>
  member this.TakeWhile : QuerySource<'T,'Q> * ('T -> bool) -> QuerySource<'T,'Q>
  member this.ThenBy : QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>
  member this.ThenByDescending : QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>
  member this.ThenByNullable : QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>
  member this.ThenByNullableDescending : QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>
  member this.Where : QuerySource<'T,'Q> * ('T -> bool) -> QuerySource<'T,'Q>
  member this.Yield : 'T -> QuerySource<'T,'Q>
  member this.YieldFrom : QuerySource<'T,'Q> -> QuerySource<'T,'Q>
  member this.Zero : unit -> QuerySource<'T,'Q>
 end

Constructors

Member

Description

new

Create an instance of this builder.

Instance Members

Member

Description

All: QuerySource<'T,'Q> * ('T -> bool) -> bool

A query operator that determines whether all elements selected so far satisfy a condition.

AverageBy: QuerySource<'T,'Q> * ('T -> ^Value) -> ^Value

A query operator that selects a value for each element selected so far and returns the average of these values.

AverageByNullable: QuerySource<'T,'Q> * ('T -> Nullable<^Value>) -> Nullable<^Value>

A query operator that selects a nullable value for each element selected so far and returns the average of these values. If any nullable does not have a value, it is ignored.

Contains: QuerySource<'T,'Q> * 'T -> bool

A query operator that determines whether the selected elements contain a specified element.

Count: QuerySource<'T,'Q> -> int

A query operator that returns the number of selected elements.

Distinct: QuerySource<'T,'Q> -> QuerySource<'T,'Q>

A query operator that selects distinct elements from the elements selected so far.

ExactlyOne: QuerySource<'T,'Q> -> 'T

A query operator that selects the single, specific element selected so far.

ExactlyOneOrDefault: QuerySource<'T,'Q> -> 'T

A query operator that selects the single, specific element of those selected so far, or a default value if that element is not found.

Exists: QuerySource<'T,'Q> * ('T -> bool) -> bool

A query operator that determines whether any element selected so far satisfies a condition.

Find: QuerySourceQuerySource<'T,'Q> * ('T -> bool) -> 'T

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

For: QuerySource<'T,'Q> * ('T -> QuerySource<'Result,'Q2>) -> QuerySource<'Result,'Q>

A method used to support the F# query syntax. Projects each element of a sequence to another sequence and combines the resulting sequences into one sequence.

GroupBy: QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<IGrouping<'Key,'T>,'Q>

A query operator that groups the elements selected so far according to a specified key selector.

GroupJoin: QuerySource<'Outer,'Q> * QuerySource<'Inner,'Q> * ('Outer -> 'Key) * ('Inner -> 'Key) * ('Outer -> seq<'Inner> -> 'Result) -> QuerySource<'Result,'Q>

A query operator that correlates two sets of selected values based on matching keys and groups the results. Normal usage is groupJoin (for y in elements2 -> key1 = key2) into group.

GroupValBy: QuerySource<'T,'Q> * ('T -> 'Value) * ('T -> 'Key) -> QuerySource<IGrouping<'Key,'Value>,'Q>

A query operator that selects a value for each element selected so far and groups the elements by the given key.

Head: QuerySource<'T,'Q> -> 'T

A query operator that selects the first element from those selected so far.

HeadOrDefault: QuerySource<'T,'Q> -> 'T

A query operator that selects the first element of those selected so far, or a default value if the sequence contains no elements.

Join: QuerySource<'Outer,'Q> * QuerySource<'Inner,'Q> * ('Outer -> 'Key) * ('Inner -> 'Key) * ('Outer -> 'Inner -> 'Result) -> QuerySource<'Result,'Q>

A query operator that correlates two sets of selected values based on matching keys. Normal usage is join (for y in elements2 -> key1 = key2).

Last: QuerySource<'T,'Q> -> 'T

A query operator that selects the last element of those selected so far.

LastOrDefault: QuerySource<'T,'Q> -> 'T

A query operator that selects the last element of those selected so far, or a default value if no element is found.

LeftOuterJoin: QuerySource<'Outer,'Q> * QuerySource<'Inner,'Q> * ('Outer -> 'Key) * ('Inner -> 'Key) * ('Outer -> seq<'Inner> -> 'Result) -> QuerySource<'Result,'Q>

A query operator that correlates two sets of selected values based on matching keys and groups the results. If any group is empty, a group with a single default value is used instead. Normal usage is leftOuterJoin (for y in elements2 -> key1 = key2) into group.

MaxBy: QuerySource<'T,'Q> * ('T -> 'Value) -> 'Value

A query operator that selects a value for each element selected so far and returns the maximum resulting value.

MaxByNullable: QuerySource<'T,'Q> * ('T -> Nullable<'Value>) -> Nullable<'Value>

A query operator that selects a nullable value for each element selected so far and returns the maximum of these values. If any nullable does not have a value, it is ignored.

MinBy: QuerySource<'T,'Q> * ('T -> 'Value) -> 'Value

A query operator that selects a value for each element selected so far and returns the minimum resulting value.

MinByNullable: QuerySource<'T,'Q> * ('T -> Nullable<'Value>) -> Nullable<'Value>

A query operator that selects a nullable value for each element selected so far and returns the minimum of these values. If any nullable does not have a value, it is ignored.

Nth: QuerySource<'T,'Q> * int -> 'T

A query operator that selects the element at a specified index among those selected so far.

Quote: Expr<'T> -> Expr<'T>

A method used to support the F# query syntax. Indicates that the query should be passed as a quotation to the Run method.

Run: Expr<QuerySource<'T,IQueryable>> ->IQueryable<'T>

A method used to support the F# query syntax. Runs the given quotation as a query using LINQ IQueryable rules.

Select: QuerySource<'T,'Q> * ('T -> 'Result) -> QuerySource<'Result,'Q>

A query operator that projects each of the elements selected so far.

Skip: QuerySource<'T,'Q> * int -> QuerySource<'T,'Q>

A query operator that bypasses a specified number of the elements selected so far and selects the remaining elements.

SkipWhile: QuerySource<'T,'Q> * ('T -> bool) -> QuerySource<'T,'Q>

A query operator that bypasses elements in a sequence as long as a specified condition is true and then selects the remaining elements.

SortBy: QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>

A query operator that sorts the elements selected so far in ascending order by the given sorting key.

SortByDescending: QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>

A query operator that sorts the elements selected so far in descending order by the given sorting key.

SortByNullable: QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>

A query operator that sorts the elements selected so far in ascending order by the given nullable sorting key.

SortByNullableDescending: QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>

A query operator that sorts the elements selected so far in descending order by the given nullable sorting key.

Source: IEnumerable<'T> -> QuerySource<'T,IEnumerable>

A method used to support the F# query syntax. Inputs to queries are implicitly wrapped by a call to one of the overloads of this method.

Source: IQueryable<'T> -> QuerySource<'T,'Q>

A method used to support the F# query syntax. Inputs to queries are implicitly wrapped by a call to one of the overloads of this method.

SumBy: QuerySource<'T,'Q> * ('T -> ^Value) -> ^Value

A query operator that selects a value for each element selected so far and returns the sum of these values.

SumByNullable: QuerySource<'T,'Q> * ('T -> Nullable<^Value>) -> Nullable<^Value>

A query operator that selects a nullable value for each element selected so far and returns the sum of these values. If any nullable does not have a value, it is ignored.

Take: QuerySource<'T,'Q> * int -> QuerySource<'T,'Q>

A query operator that selects a specified number of contiguous elements from those selected so far.

TakeWhile: QuerySource<'T,'Q> * ('T -> bool) -> QuerySource<'T,'Q>

A query operator that selects elements from a sequence as long as a specified condition is true, and then skips the remaining elements.

ThenBy: QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>

A query operator that performs a subsequent ordering of the elements selected so far in ascending order by the given sorting key. This operator may only be used immediately after a sortBy, sortByDescending, thenBy or thenByDescending, or their nullable variants.

ThenByDescending: QuerySource<'T,'Q> * ('T -> 'Key) -> QuerySource<'T,'Q>

A query operator that performs a subsequent ordering of the elements selected so far in descending order by the given sorting key. This operator may only be used immediately after a sortBy, sortByDescending, thenBy or thenByDescending, or their nullable variants.

ThenByNullable: QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>

A query operator that performs a subsequent ordering of the elements selected so far in ascending order by the given nullable sorting key. This operator may only be used immediately after a sortBy, sortByDescending, thenBy or thenByDescending, or their nullable variants.

ThenByNullableDescending: QuerySource<'T,'Q> * ('T -> Nullable<'Key>) -> QuerySource<'T,'Q>

A query operator that performs a subsequent ordering of the elements selected so far in descending order by the given nullable sorting key. This operator may only be used immediately after a sortBy, sortByDescending, thenBy or thenByDescending, or their nullable variants.

Where: QuerySource<'T,'Q> * ('T -> bool) -> QuerySource<'T,'Q>

A query operator that selects those elements based on a specified predicate.

Yield: 'T -> QuerySource<'T,'Q>

A method used to support the F# query syntax. Returns a sequence of length one that contains the specified value.

YieldFrom: QuerySource<'T,'Q> -> QuerySource<'T,'Q>

A method used to support the F# query syntax. Returns a sequence that contains the specified values.

Zero: unit -> QuerySource<'T,'Q>

A method used to support the F# query syntax. Returns an empty sequence that has the specified type argument.

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

Microsoft.FSharp.Linq Namespace (F#)

Query Expressions (F#)