DbFunctions.AddYears 方法

定义

重载

AddYears(Nullable<DateTimeOffset>, Nullable<Int32>)

当用作 LINQ to Entities 查询的一部分时,此方法调用规范的 AddYears EDM 函数,将给定的年数添加到日期/时间。

AddYears(Nullable<DateTime>, Nullable<Int32>)

当用作 LINQ to Entities 查询的一部分时,此方法调用规范的 AddYears EDM 函数,将给定的年数添加到日期/时间。

AddYears(Nullable<DateTimeOffset>, Nullable<Int32>)

当用作 LINQ to Entities 查询的一部分时,此方法调用规范的 AddYears EDM 函数,将给定的年数添加到日期/时间。

[System.Data.Entity.DbFunction("Edm", "AddYears")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateValue")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="addValue")]
public static Nullable<DateTimeOffset> AddYears(Nullable<DateTimeOffset> dateValue, Nullable<int> addValue);
static member AddYears : Nullable<DateTimeOffset> * Nullable<int> -> Nullable<DateTimeOffset>
Public Shared Function AddYears (dateValue As Nullable(Of DateTimeOffset), addValue As Nullable(Of Integer)) As Nullable(Of DateTimeOffset)

参数

dateValue
Nullable<DateTimeOffset>

输入日期/时间。

addValue
Nullable<Int32>

要添加的年数。

返回

生成的日期/时间。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。 此函数将转换为数据库中的相应函数。

适用于

AddYears(Nullable<DateTime>, Nullable<Int32>)

当用作 LINQ to Entities 查询的一部分时,此方法调用规范的 AddYears EDM 函数,将给定的年数添加到日期/时间。

[System.Data.Entity.DbFunction("Edm", "AddYears")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="addValue")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateValue")]
public static Nullable<DateTime> AddYears(Nullable<DateTime> dateValue, Nullable<int> addValue);
static member AddYears : Nullable<DateTime> * Nullable<int> -> Nullable<DateTime>
Public Shared Function AddYears (dateValue As Nullable(Of DateTime), addValue As Nullable(Of Integer)) As Nullable(Of DateTime)

参数

dateValue
Nullable<DateTime>

输入日期/时间。

addValue
Nullable<Int32>

要添加的年数。

返回

生成的日期/时间。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。 此函数将转换为数据库中的相应函数。

适用于