DbFunctions.DiffMicroseconds 方法 (Nullable<TimeSpan>, Nullable<TimeSpan>)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
用於 LINQ to Entities 查詢時,此方法會叫用標準 EDM 函式 DiffMicroseconds 以計算兩個時間範圍的相距微秒數。
命名空間: System.Data.Entity
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "timeValue1")> _
<DbFunctionAttribute("Edm", "DiffMicroseconds")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "timeValue2")> _
Public Shared Function DiffMicroseconds ( _
timeValue1 As Nullable(Of TimeSpan), _
timeValue2 As Nullable(Of TimeSpan) _
) As Nullable(Of Integer)
'用途
Dim timeValue1 As Nullable(Of TimeSpan)
Dim timeValue2 As Nullable(Of TimeSpan)
Dim returnValue As Nullable(Of Integer)
returnValue = DbFunctions.DiffMicroseconds(timeValue1, _
timeValue2)
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue1")]
[DbFunctionAttribute("Edm", "DiffMicroseconds")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue2")]
public static Nullable<int> DiffMicroseconds(
Nullable<TimeSpan> timeValue1,
Nullable<TimeSpan> timeValue2
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"timeValue1")]
[DbFunctionAttribute(L"Edm", L"DiffMicroseconds")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"timeValue2")]
public:
static Nullable<int> DiffMicroseconds(
Nullable<TimeSpan> timeValue1,
Nullable<TimeSpan> timeValue2
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue1")>]
[<DbFunctionAttribute("Edm", "DiffMicroseconds")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue2")>]
static member DiffMicroseconds :
timeValue1:Nullable<TimeSpan> *
timeValue2:Nullable<TimeSpan> -> Nullable<int>
public static function DiffMicroseconds(
timeValue1 : Nullable<TimeSpan>,
timeValue2 : Nullable<TimeSpan>
) : Nullable<int>
參數
- timeValue1
類型:System.Nullable<TimeSpan>
第一個時間範圍。
- timeValue2
類型:System.Nullable<TimeSpan>
第二個時間範圍。
傳回值
類型:System.Nullable<Int32>
第一個和第二個時間範圍的相距微秒數。
備註
您不可以直接呼叫此函式。 此函式只能出現在 LINQ to Entities 查詢內。 此函式會轉譯為資料庫中的對應函式。