EdmFunctions.DiffSeconds Method (DbExpression, DbExpression)
Creates a DbFunctionExpression that invokes the canonical 'DiffSeconds' function with the specified arguments, which must each have a DateTime, DateTimeOffset or Time result type. The result type of timeValue1 must match the result type of timeValue2. The result type of the expression is Edm.Int32.
Assembly: EntityFramework (in EntityFramework.dll)
public static DbFunctionExpression DiffSeconds( this DbExpression timeValue1, DbExpression timeValue2 )
Parameters
- timeValue1
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the first DateTime, DateTimeOffset or Time value.
- timeValue2
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the DateTime, DateTimeOffset or Time for which the second difference from timeValue1 should be calculated.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpressionA new DbFunctionExpression that returns the second difference between timeValue1 and timeValue2.
Exception | Condition |
---|---|
ArgumentNullException | timeValue1 or timeValue2 is null. |
ArgumentException | No overload of the canonical 'DiffSeconds' function accepts arguments with the result types of timeValue1 and timeValue2. |