DbFunctions.AddHours Method

Definition

Overloads

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

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

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

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

AddHours(Nullable<TimeSpan>, Nullable<Int32>)

When used as part of a LINQ to Entities query, this method invokes the canonical AddHours EDM function to add the given number of hours to a time span.

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

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

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

Parameters

timeValue
Nullable<DateTime>

The input date/time.

addValue
Nullable<Int32>

The number of hours to add.

Returns

A resulting date/time.

Attributes

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

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

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

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

Parameters

timeValue
Nullable<DateTimeOffset>

The input date/time.

addValue
Nullable<Int32>

The number of hours to add.

Returns

A resulting date/time.

Attributes

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

AddHours(Nullable<TimeSpan>, Nullable<Int32>)

When used as part of a LINQ to Entities query, this method invokes the canonical AddHours EDM function to add the given number of hours to a time span.

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

Parameters

timeValue
Nullable<TimeSpan>

The input date/time.

addValue
Nullable<Int32>

The number of hours to add.

Returns

A resulting time span.

Attributes

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