SqlServerDbFunctionsExtensions.DateDiffDay 方法

定義

多載

DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 SQL Server 的 DATEDIFF(day, @startDate, @endDate)

DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 SQL Server 的 DATEDIFF(day, @startDate, @endDate)

DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 SQL Server 的 DATEDIFF(day, @startDate, @endDate)

DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 SQL Server 的 DATEDIFF(day, @startDate, @endDate)

DateDiffDay(DbFunctions, DateTime, DateTime)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 SQL Server 的 DATEDIFF(day, @startDate, @endDate)

DateDiffDay(DbFunctions, DateOnly, DateOnly)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 SQL Server 的 DATEDIFF(day, @startDate, @endDate)

DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 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

DbFunctions 執行個體。

startDate
Nullable<DateTime>

計算的開始日期。

endDate
Nullable<DateTime>

計算的結束日期。

傳回

日期之間交叉的日期界限數目。

備註

如需詳細資訊和範例,請參閱使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 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

DbFunctions 執行個體。

startDate
Nullable<DateTimeOffset>

計算的開始日期。

endDate
Nullable<DateTimeOffset>

計算的結束日期。

傳回

日期之間交叉的日期界限數目。

備註

如需詳細資訊和範例,請參閱使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 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

DbFunctions 執行個體。

startDate
Nullable<DateOnly>

計算的開始日期。

endDate
Nullable<DateOnly>

計算的結束日期。

傳回

日期之間交叉的日期界限數目。

備註

如需詳細資訊和範例,請參閱使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 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

DbFunctions 執行個體。

startDate
DateTimeOffset

計算的開始日期。

endDate
DateTimeOffset

計算的結束日期。

傳回

日期之間交叉的日期界限數目。

備註

如需詳細資訊和範例,請參閱使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffDay(DbFunctions, DateTime, DateTime)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 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

DbFunctions 執行個體。

startDate
DateTime

計算的開始日期。

endDate
DateTime

計算的結束日期。

傳回

日期之間交叉的日期界限數目。

備註

如需詳細資訊和範例,請參閱使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffDay(DbFunctions, DateOnly, DateOnly)

計算 在 和 endDate 之間 startDate 交叉的日界限數目。 對應至 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

DbFunctions 執行個體。

startDate
DateOnly

計算的開始日期。

endDate
DateOnly

計算的結束日期。

傳回

日期之間交叉的日期界限數目。

備註

如需詳細資訊和範例,請參閱使用 EF Core 存取SQL Server和Azure SQL資料庫

適用於