DbFunctions.AddYears 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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>
输入日期/时间。
返回
生成的日期/时间。
- 属性
注解
不能直接调用此函数。 此函数只能出现在 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)
参数
返回
生成的日期/时间。
- 属性
注解
不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。 此函数将转换为数据库中的相应函数。