DataServiceContext.TryGetUri(Object, Uri) Método

Definição

Recupera o URI canônico associado à entidade especificada, se disponível.Retrieves the canonical URI associated with the specified entity, if available.

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

Parâmetros

entity
Object

A entidade identificada pela identity.The entity identified by the identity.

identity
Uri

O URI da entidade.The URI of the entity.

Retornos

Boolean

Retorna verdadeiro se o URI canônico é retornado no parâmetro de saída.Returns true if the canonical URI is returned in the out parameter. Se a entidade especificada não for acompanhada pelo DataServiceContext ou estiver no estado adicionado, nenhum URI estará disponível e falso será retornado.If the specified entity is not tracked by the DataServiceContext or is in the added state, no URI is available and false is returned.

Exceções

Quando entity é null.When entity is null.

Comentários

Os objetos no Added estado ainda não têm um URI.Objects in the Added state do not yet have a URI.

Aplica-se a