EdmFunctions.DiffMonths(DbExpression, DbExpression) 方法

定義

建立會使用指定引數叫用標準 'DiffMonths' 函式的 DbFunctionExpression,其中的引數都必須具有 DateTime 或 DateTimeOffset 結果型別。 運算式的結果類型為 Edm.Int32。

C#
public static System.Data.Common.CommandTrees.DbFunctionExpression DiffMonths (this System.Data.Common.CommandTrees.DbExpression dateValue1, System.Data.Common.CommandTrees.DbExpression dateValue2);

參數

dateValue1
DbExpression

指定第一個日期值引數的運算式。

dateValue2
DbExpression

指定第二個日期值引數的運算式。

傳回

傳回 與 dateValue2之間dateValue1差異月份數的新 DbFunctionExpression。

適用於

產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1