EdmFunctions.CreateDateTime Method (DbExpression, DbExpression, DbExpression, DbExpression, DbExpression, DbExpression)

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a DbFunctionExpression that invokes the canonical 'CreateDateTime' function with the specified arguments. second must have a result type of Edm.Double, while all other arguments must have a result type of Edm.Int32. The result type of the expression is Edm.DateTime.

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

public static DbFunctionExpression CreateDateTime(
	DbExpression year,
	DbExpression month,
	DbExpression day,
	DbExpression hour,
	DbExpression minute,
	DbExpression second
)

Parameters

year
Type: System.Data.Common.CommandTrees.DbExpression

An expression that provides the year value for the new DateTime instance.

month
Type: System.Data.Common.CommandTrees.DbExpression

An expression that provides the month value for the new DateTime instance.

day
Type: System.Data.Common.CommandTrees.DbExpression

An expression that provides the day value for the new DateTime instance.

hour
Type: System.Data.Common.CommandTrees.DbExpression

An expression that provides the hour value for the new DateTime instance.

minute
Type: System.Data.Common.CommandTrees.DbExpression

An expression that provides the minute value for the new DateTime instance.

second
Type: System.Data.Common.CommandTrees.DbExpression

An expression that provides the second value for the new DateTime instance.

Return Value

Type: System.Data.Common.CommandTrees.DbFunctionExpression

A new DbFunctionExpression that returns a new DateTime based on the specified values.

Exception Condition
ArgumentNullException

yearmonthdayhourminutesecond

ArgumentException

yearmonthdayhourminutesecond

.NET Framework
Available since 4.5
Return to top
Show: