語言

EdmFunctions.DiffHours(DbExpression, DbExpression) 方法

定義

建立 DbFunctionExpression 一個,呼叫典型的「DiffHours」函式,並指定參數,每個參數必須有 DateTime、DateTimeOffset 或 Time 結果類型。 表達式的結果類型為Edm.Int32。

public static System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpression DiffHours(this System.Data.Entity.Core.Common.CommandTrees.DbExpression timeValue1, System.Data.Entity.Core.Common.CommandTrees.DbExpression timeValue2);
static member DiffHours : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Common.CommandTrees.DbExpression -> System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpression
<Extension()>
Public Function DiffHours (timeValue1 As DbExpression, timeValue2 As DbExpression) As DbFunctionExpression

參數

timeValue1
DbExpression

一個指定首次時間值參數的表達式。

timeValue2
DbExpression

一個指定第二個時間值參數的表達式。

傳回

一個新的 DbFunctionExpression,回傳 timeValue1 與 timeValue2 之間的小時數差值。

適用於