Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataServiceContext.TryGetEntity<TEntity> Method (Uri, TEntity)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

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

Parameters

identity
Type: System.Uri

The URI of the tracked entity to be retrieved.

entity
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.

Type Parameters

TEntity

The type of the entity.

Exception Condition
ArgumentNullException

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.

.NET Framework
Available since 3.5
Silverlight
Available since 2.0
Return to top
Show: