EdmFunctions.TruncateTime Method (DbExpression)

 

Creates a DbFunctionExpression that invokes the canonical 'TruncateTime' function with the specified argument, which must have a DateTime or DateTimeOffset result type. The result type of the expression is the same as the result type of dateValue.

Namespace:   System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
Assembly:  EntityFramework (in EntityFramework.dll)

public static DbFunctionExpression TruncateTime(
	this DbExpression dateValue
)

Parameters

dateValue
Type: System.Data.Entity.Core.Common.CommandTrees.DbExpression

An expression that specifies the value for which the time portion should be truncated.

Return Value

Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpression

A new DbFunctionExpression that returns the value of dateValue with time set to zero.

Exception Condition
ArgumentNullException

dateValue is null.

ArgumentException

No overload of the canonical 'TruncateTime' function accepts an argument with the result type of dateValue.