DbFunctions.DiffDays Method

Entity Framework 6.0
 

When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticDiffDays(Nullable<DateTime>, Nullable<DateTime>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.

System_CAPS_pubmethodSystem_CAPS_staticDiffDays(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.

Return to top

DbFunctions.DiffDays Method (Nullable<DateTime>, Nullable<DateTime>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.

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

Parameters

dateValue1
Type: System.Nullable<DateTime>

The first date/time.

dateValue2
Type: System.Nullable<DateTime>

The second date/time.

Return Value

Type: System.Nullable<Int32>

The number of days between the first and second date/times.

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.

Return to top

DbFunctions.DiffDays Method (Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.

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

Parameters

dateValue1
Type: System.Nullable<DateTimeOffset>

The first date/time.

dateValue2
Type: System.Nullable<DateTimeOffset>

The second date/time.

Return Value

Type: System.Nullable<Int32>

The number of days between the first and second date/times.

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.

Return to top
Show: