EntityFunctions.AddYears Method

 

Invokes the canonical AddYears EDM function to add the given number of years to a date/time when used a part of a LINQ to Entities query.

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddYears(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_CAPS_pubmethodSystem_CAPS_staticAddYears(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.


EntityFunctions.AddYears Method (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.

[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "dateValue")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "addValue")]
[DbFunctionAttribute("Edm", "AddYears")]
public static Nullable<DateTime> AddYears(
	Nullable<DateTime> dateValue,
	Nullable<int> addValue
)

Parameters

dateValue
Type: System.Nullable<DateTime>

The input date/time.

addValue
Type: System.Nullable<Int32>

The number of years to add.

Return Value

Type: System.Nullable<DateTime>

A resulting date/time.

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.


EntityFunctions.AddYears Method (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.

[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "dateValue")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "addValue")]
[DbFunctionAttribute("Edm", "AddYears")]
public static Nullable<DateTimeOffset> AddYears(
	Nullable<DateTimeOffset> dateValue,
	Nullable<int> addValue
)

Parameters

dateValue
Type: System.Nullable<DateTimeOffset>

The input date/time.

addValue
Type: System.Nullable<Int32>

The number of years to add.

Return Value

Type: System.Nullable<DateTimeOffset>

A resulting date/time.

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.