SqlServerDbFunctionsExtensions.DateDiffDay 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
计算两者之间跨越 |
| DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
计算两者之间跨越 |
| DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
计算两者之间跨越 |
| DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset) |
计算两者之间跨越 |
| DateDiffDay(DbFunctions, DateTime, DateTime) |
计算两者之间跨越 |
| DateDiffDay(DbFunctions, DateOnly, DateOnly) |
计算两者之间跨越 |
DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
计算两者之间跨越startDateendDate的日边界数。
对应于SQL Server的 DATEDIFF(day, @startDate, @endDate)。
public static int? DateDiffDay(this Microsoft.EntityFrameworkCore.DbFunctions _, DateTime? startDate, DateTime? endDate);
static member DateDiffDay : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
<Extension()>
Public Function DateDiffDay (_ As DbFunctions, startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)
参数
DbFunctions 实例。
返回
日期之间跨越的日期边界数。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。
适用于
DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
计算两者之间跨越startDateendDate的日边界数。
对应于SQL Server的 DATEDIFF(day, @startDate, @endDate)。
public static int? DateDiffDay(this Microsoft.EntityFrameworkCore.DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate);
static member DateDiffDay : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
<Extension()>
Public Function DateDiffDay (_ As DbFunctions, startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)
参数
DbFunctions 实例。
- startDate
- Nullable<DateTimeOffset>
计算的开始日期。
- endDate
- Nullable<DateTimeOffset>
计算的结束日期。
返回
日期之间跨越的日期边界数。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。
适用于
DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)
计算两者之间跨越startDateendDate的日边界数。
对应于SQL Server的 DATEDIFF(day, @startDate, @endDate)。
public static int? DateDiffDay(this Microsoft.EntityFrameworkCore.DbFunctions _, DateOnly? startDate, DateOnly? endDate);
static member DateDiffDay : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateOnly> * Nullable<DateOnly> -> Nullable<int>
<Extension()>
Public Function DateDiffDay (_ As DbFunctions, startDate As Nullable(Of DateOnly), endDate As Nullable(Of DateOnly)) As Nullable(Of Integer)
参数
DbFunctions 实例。
返回
日期之间跨越的日期边界数。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。
适用于
DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset)
计算两者之间跨越startDateendDate的日边界数。
对应于SQL Server的 DATEDIFF(day, @startDate, @endDate)。
public static int DateDiffDay(this Microsoft.EntityFrameworkCore.DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate);
static member DateDiffDay : Microsoft.EntityFrameworkCore.DbFunctions * DateTimeOffset * DateTimeOffset -> int
<Extension()>
Public Function DateDiffDay (_ As DbFunctions, startDate As DateTimeOffset, endDate As DateTimeOffset) As Integer
参数
DbFunctions 实例。
- startDate
- DateTimeOffset
计算的开始日期。
- endDate
- DateTimeOffset
计算的结束日期。
返回
日期之间跨越的日期边界数。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。
适用于
DateDiffDay(DbFunctions, DateTime, DateTime)
计算两者之间跨越startDateendDate的日边界数。
对应于SQL Server的 DATEDIFF(day, @startDate, @endDate)。
public static int DateDiffDay(this Microsoft.EntityFrameworkCore.DbFunctions _, DateTime startDate, DateTime endDate);
static member DateDiffDay : Microsoft.EntityFrameworkCore.DbFunctions * DateTime * DateTime -> int
<Extension()>
Public Function DateDiffDay (_ As DbFunctions, startDate As DateTime, endDate As DateTime) As Integer
参数
DbFunctions 实例。
- startDate
- DateTime
计算的开始日期。
- endDate
- DateTime
计算的结束日期。
返回
日期之间跨越的日期边界数。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。
适用于
DateDiffDay(DbFunctions, DateOnly, DateOnly)
计算两者之间跨越startDateendDate的日边界数。
对应于SQL Server的 DATEDIFF(day, @startDate, @endDate)。
public static int DateDiffDay(this Microsoft.EntityFrameworkCore.DbFunctions _, DateOnly startDate, DateOnly endDate);
static member DateDiffDay : Microsoft.EntityFrameworkCore.DbFunctions * DateOnly * DateOnly -> int
<Extension()>
Public Function DateDiffDay (_ As DbFunctions, startDate As DateOnly, endDate As DateOnly) As Integer
参数
DbFunctions 实例。
- startDate
- DateOnly
计算的开始日期。
- endDate
- DateOnly
计算的结束日期。
返回
日期之间跨越的日期边界数。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。