EdmFunctions.DiffMilliseconds Method (DbExpression, DbExpression)
Creates a DbFunctionExpression that invokes the canonical 'DiffMilliseconds' 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 DiffMilliseconds( 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 millisecond difference from timeValue1 should be calculated.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpressionA new DbFunctionExpression that returns the millisecond difference between timeValue1 and timeValue2.
Exception | Condition |
---|---|
ArgumentNullException | timeValue1 or timeValue2 is null. |
ArgumentException | No overload of the canonical 'DiffMilliseconds' function accepts arguments with the result type of timeValue1 and timeValue2. |