EntityFunctions.DiffHours 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| DiffHours(Nullable<DateTime>, Nullable<DateTime>) |
當作為 LINQ 對 Entities 查詢的一部分時,此方法會調用典型的 DiffHours EDM 函數來計算兩個日期/時間之間的時數。 |
| DiffHours(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
當作為 LINQ 對 Entities 查詢的一部分時,此方法會調用典型的 DiffHours EDM 函數來計算兩個日期/時間之間的時數。 |
| DiffHours(Nullable<TimeSpan>, Nullable<TimeSpan>) |
當作為 LINQ 對實體查詢的一部分時,此方法會調用典型的 DiffHours EDM 函數來計算兩個時間段之間的工時數。 |
DiffHours(Nullable<DateTime>, Nullable<DateTime>)
當作為 LINQ 對 Entities 查詢的一部分時,此方法會調用典型的 DiffHours EDM 函數來計算兩個日期/時間之間的時數。
[System.Data.Entity.DbFunction("Edm", "DiffHours")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue1")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue2")]
public static Nullable<int> DiffHours(Nullable<DateTime> timeValue1, Nullable<DateTime> timeValue2);
static member DiffHours : Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DiffHours (timeValue1 As Nullable(Of DateTime), timeValue2 As Nullable(Of DateTime)) As Nullable(Of Integer)
參數
傳回
第一次和第二次日期/時間之間的時間數。
- 屬性
備註
你不能直接呼叫這個函式。 此函式只能出現在 LINQ 對 Entities 查詢中。 這個函式會被轉換成資料庫中的對應函式。
適用於
DiffHours(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
當作為 LINQ 對 Entities 查詢的一部分時,此方法會調用典型的 DiffHours EDM 函數來計算兩個日期/時間之間的時數。
[System.Data.Entity.DbFunction("Edm", "DiffHours")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue1")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue2")]
public static Nullable<int> DiffHours(Nullable<DateTimeOffset> timeValue1, Nullable<DateTimeOffset> timeValue2);
static member DiffHours : Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DiffHours (timeValue1 As Nullable(Of DateTimeOffset), timeValue2 As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)
參數
- timeValue1
- Nullable<DateTimeOffset>
第一次約會/時間。
- timeValue2
- Nullable<DateTimeOffset>
第二次約會/時間。
傳回
第一次和第二次日期/時間之間的時間數。
- 屬性
備註
你不能直接呼叫這個函式。 此函式只能出現在 LINQ 對 Entities 查詢中。 這個函式會被轉換成資料庫中的對應函式。
適用於
DiffHours(Nullable<TimeSpan>, Nullable<TimeSpan>)
當作為 LINQ 對實體查詢的一部分時,此方法會調用典型的 DiffHours EDM 函數來計算兩個時間段之間的工時數。
[System.Data.Entity.DbFunction("Edm", "DiffHours")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue2")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue1")]
public static Nullable<int> DiffHours(Nullable<TimeSpan> timeValue1, Nullable<TimeSpan> timeValue2);
static member DiffHours : Nullable<TimeSpan> * Nullable<TimeSpan> -> Nullable<int>
Public Shared Function DiffHours (timeValue1 As Nullable(Of TimeSpan), timeValue2 As Nullable(Of TimeSpan)) As Nullable(Of Integer)
參數
傳回
第一次和第二次時間間隔的時間長短。
- 屬性
備註
你不能直接呼叫這個函式。 此函式只能出現在 LINQ 對 Entities 查詢中。 這個函式會被轉換成資料庫中的對應函式。