DataServiceContext.TryGetUri(Object, Uri) 方法

定義

擷取與指定之實體相關聯的標準 URI (若有的話)。

public:
 bool TryGetUri(System::Object ^ entity, [Runtime::InteropServices::Out] Uri ^ % identity);
public bool TryGetUri (object entity, out Uri identity);
member this.TryGetUri : obj * Uri -> bool
Public Function TryGetUri (entity As Object, ByRef identity As Uri) As Boolean

參數

entity
Object

identity 所識別的實體。

identity
Uri

實體的 URI。

傳回

如果標準 URI 是以 out 參數傳回的,則傳回 true。 如果指定的實體未受 DataServiceContext 追蹤或處於已加入狀態,則不會有可用的 URI,並且傳回 false。

例外狀況

entitynull 時。

備註

Added 狀態的物件還沒有 URI。

適用於