EdmFunctions.CreateDateTimeOffset Method (DbExpression, DbExpression, DbExpression, DbExpression, DbExpression, DbExpression, DbExpression)
Creates a DbFunctionExpression that invokes the canonical 'CreateDateTimeOffset' 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.DateTimeOffset.
Assembly: EntityFramework (in EntityFramework.dll)
public static DbFunctionExpression CreateDateTimeOffset( DbExpression year, DbExpression month, DbExpression day, DbExpression hour, DbExpression minute, DbExpression second, DbExpression timeZoneOffset )
Parameters
- year
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the year value for the new DateTimeOffset instance.
- month
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the month value for the new DateTimeOffset instance.
- day
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the day value for the new DateTimeOffset instance.
- hour
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the hour value for the new DateTimeOffset instance.
- minute
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the minute value for the new DateTimeOffset instance.
- second
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the second value for the new DateTimeOffset instance.
- timeZoneOffset
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that provides the number of minutes in the time zone offset value for the new DateTimeOffset instance.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpressionA new DbFunctionExpression that returns a new DateTimeOffset based on the specified values.
Exception | Condition |
---|---|
ArgumentNullException | year, month, day, hour, minute, second or timeZoneOffset is null. |
ArgumentException | No overload of the canonical 'CreateDateTimeOffset' function accepts arguments with the result type of year, month, day, hour, minute, second and timeZoneOffset. |