EdmFunctions.AddMonths Method (DbExpression, DbExpression)
Creates a DbFunctionExpression that invokes the canonical 'AddMonths' function with the specified arguments, which must have DateTime or DateTimeOffset and integer result types. The result type of the expression is the same as the result type of dateValue.
Assembly: EntityFramework (in EntityFramework.dll)
public static DbFunctionExpression AddMonths( this DbExpression dateValue, DbExpression addValue )
Parameters
- dateValue
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the value to which addValue should be added.
- addValue
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the number of months to add to dateValue.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpressionA new DbFunctionExpression that adds the number of months specified by addValue to the value specified by dateValue.
Exception | Condition |
---|---|
ArgumentNullException | dateValue or addValue is null. |
ArgumentException | No overload of the canonical ‘AddMonths’ function accepts arguments with the result types of dateValue and addValue. |