Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

DataServiceContext.TryGetEntity<TEntity> Method

Test retrieval of an entity being tracked by the DataServiceContext by reference to the URI of the entity.

Namespace:  System.Data.Services.Client
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)

public bool TryGetEntity<TEntity>(
	Uri identity,
	out TEntity entity
where TEntity : class

Type Parameters


The type of the entity.


Type: System.Uri
The URI of the tracked entity to be retrieved.
Type: TEntity
The entity to be retrieved.

Return Value

Type: System.Boolean
If an entity is found at resourceUri, the entity is returned in the out parameter entity and true is returned. If no entity is found, false is returned.


When identity is null.

If an entity is in the Detached or Added state, it does not have a URI and cannot be retrieved by using this method.

© 2015 Microsoft