SpatialEdmFunctions.Distance(DbExpression, DbExpression) 方法

定義

建立 DbFunctionExpression 一個,能呼叫典型的「距離」函數,並指定參數,且每個參數必須有一個 Edm.Geography 或 Edm.Geometry 的結果型別。 結果spatialValue1類型必須與結果類型相符。spatialValue2 表達式的結果類型為Edm.Double。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbFunctionExpression ^ Distance(System::Data::Common::CommandTrees::DbExpression ^ spatialValue1, System::Data::Common::CommandTrees::DbExpression ^ spatialValue2);
public static System.Data.Common.CommandTrees.DbFunctionExpression Distance(this System.Data.Common.CommandTrees.DbExpression spatialValue1, System.Data.Common.CommandTrees.DbExpression spatialValue2);
static member Distance : System.Data.Common.CommandTrees.DbExpression * System.Data.Common.CommandTrees.DbExpression -> System.Data.Common.CommandTrees.DbFunctionExpression
<Extension()>
Public Function Distance (spatialValue1 As DbExpression, spatialValue2 As DbExpression) As DbFunctionExpression

參數

spatialValue1
DbExpression

一個指定第一個空間值的表達式。

spatialValue2
DbExpression

一個表達式,用來指定應該從哪裡來測量距離 spatialValue1 的空間值。

傳回

一個新的 DbFunctionExpression,回傳與 中最近點spatialValue1spatialValue1之間的距離。

例外狀況

spatialValue1 spatialValue2

spatialValue1 spatialValue2

適用於