DbFunctions.AddYears DbFunctions.AddYears DbFunctions.AddYears Method

Definition

Overloads

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

When used as part of a LINQ to Entities query, this method invokes the canonical AddYears EDM function to add the given number of years to a date/time.

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

When used as part of a LINQ to Entities query, this method invokes the canonical AddYears EDM function to add the given number of years to a date/time.

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

When used as part of a LINQ to Entities query, this method invokes the canonical AddYears EDM function to add the given number of years to a date/time.

[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)

Parameters

dateValue
Nullable<DateTimeOffset>

The input date/time.

addValue
Nullable<Int32>

The number of years to add.

Returns

A resulting date/time.

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database.

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

When used as part of a LINQ to Entities query, this method invokes the canonical AddYears EDM function to add the given number of years to a date/time.

[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)

Parameters

dateValue
Nullable<DateTime>

The input date/time.

addValue
Nullable<Int32>

The number of years to add.

Returns

A resulting date/time.

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database.

Applies to