共用方式為


QueryBuilder.AverageByNullable<'T,'Q,^Value> 方法 (F#)

查詢運算子,會選取目前選取之每個項目的可為 null 的值,並傳回這些值的平均值。 如果有任何可為 null 並沒有值,則會忽略它。

Namespace/Module Path:Microsoft.FSharp.Linq

組件:FSharp.Core (在 FSharp.Core.dll 中)

// Signature:
member this.AverageByNullable : QuerySource<'T,'Q> * ('T -> Nullable<^Value>) -> Nullable<^Value> when ^Value with static member (+) and ^Value with static member DivideByInt and ^Value with static member Zero and ^Value : (new : unit ->  ^Value) and ^Value : struct and ^Value :> ValueType

// Usage:
queryBuilder.AverageByNullable (source, projection)

參數

  • source
    型別: QuerySource<'T,'Q>

    輸入查詢。

  • projection
    型別:" T " - > Nullable<^Value>

    計算每個項目的值。

傳回值

平均值。

備註

null值不會影響的平均值。

如需詳細資訊和範例,請參閱 查詢運算式 (F#)

平台

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

版本資訊

F# 核心程式庫版本

支援版本:4.0,可攜式執行檔 (PE)。

請參閱

參考

Linq.QueryBuilder 類別 (F#)

Microsoft.FSharp.Linq 命名空間 (F#)

查詢運算式 (F#)