Share via


DataServiceContext.ResolveName 屬性

定義

取得或設定函式,當您傳送實體到資料服務時,此函式會覆寫用戶端程式庫所用的預設型別解析策略。

public:
 property Func<Type ^, System::String ^> ^ ResolveName { Func<Type ^, System::String ^> ^ get(); void set(Func<Type ^, System::String ^> ^ value); };
public Func<Type,string> ResolveName { get; set; }
member this.ResolveName : Func<Type, string> with get, set
Public Property ResolveName As Func(Of Type, String)

屬性值

傳回字串,其中包含 DataServiceContext 的名稱。

備註

啟用對用戶端程式庫使用之預設型別解析的覆寫。 將此屬性設定為識別函式的委派,此函式用來將用戶端應用程式中的型別解析為命名空間限定的型別名稱。 這樣一來,用戶端就可以在伺服器回應所提供的型別名稱以及位於用戶端的型別之間,執行自訂對應。

注意

這個方法會為指定的型別啟用已序列化為目標表示 (如 Atom 或 JSON) 之實體名稱的覆寫。

適用於