语言

SqlServerDbFunctionsExtensions.DateFromParts 方法

定义

将结构的新实例 DateTime 初始化为指定的年份、月、日。 对应于SQL Server的 DATEFROMPARTS(year, month, day)。

public static DateTime DateFromParts(this Microsoft.EntityFrameworkCore.DbFunctions _, int year, int month, int day);
static member DateFromParts : Microsoft.EntityFrameworkCore.DbFunctions * int * int * int -> DateTime
<Extension()>
Public Function DateFromParts (_ As DbFunctions, year As Integer, month As Integer, day As Integer) As DateTime

参数

_
DbFunctions

DbFunctions 实例。

year
Int32

年份(1753至9999年)。

month
Int32

月份(1 至 12)。

day
Int32

日期(1 到月份中的天数)。

返回

结构的新实例 DateTime 到指定的年份、月、日。

注解

有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。

适用于