EntityFunctions.DiffNanoseconds 方法 (Nullable<TimeSpan>, Nullable<TimeSpan>)
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
作为 LINQ to Entities 查询的一部分使用时,此方法调用规范 DiffNanoseconds EDM 函数以计算两个时间跨度间隔的纳秒数。
命名空间: System.Data.Entity.Core.Objects
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "timeValue1")> _
<DbFunctionAttribute("Edm", "DiffNanoseconds")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "timeValue2")> _
Public Shared Function DiffNanoseconds ( _
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 = EntityFunctions.DiffNanoseconds(timeValue1, _
timeValue2)
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue1")]
[DbFunctionAttribute("Edm", "DiffNanoseconds")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue2")]
public static Nullable<int> DiffNanoseconds(
Nullable<TimeSpan> timeValue1,
Nullable<TimeSpan> timeValue2
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"timeValue1")]
[DbFunctionAttribute(L"Edm", L"DiffNanoseconds")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"timeValue2")]
public:
static Nullable<int> DiffNanoseconds(
Nullable<TimeSpan> timeValue1,
Nullable<TimeSpan> timeValue2
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue1")>]
[<DbFunctionAttribute("Edm", "DiffNanoseconds")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeValue2")>]
static member DiffNanoseconds :
timeValue1:Nullable<TimeSpan> *
timeValue2:Nullable<TimeSpan> -> Nullable<int>
public static function DiffNanoseconds(
timeValue1 : Nullable<TimeSpan>,
timeValue2 : Nullable<TimeSpan>
) : Nullable<int>
参数
- timeValue1
类型:System.Nullable<TimeSpan>
第一个时间跨度。
- timeValue2
类型:System.Nullable<TimeSpan>
第二个时间跨度。
返回值
类型:System.Nullable<Int32>
第一个时间跨度和第二个时间跨度间隔的纳秒数。
备注
无法直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。 此函数将被转换为数据库中对应的函数。