DataServiceContext.TryGetEntity<TEntity>(Uri, TEntity) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Test retrieval of an entity being tracked by the DataServiceContext by reference to the URI of the entity.
public:
generic <typename TEntity>
where TEntity : class bool TryGetEntity(Uri ^ identity, [Runtime::InteropServices::Out] TEntity % entity);
public bool TryGetEntity<TEntity>(Uri identity, out TEntity entity) where TEntity : class;
member this.TryGetEntity : Uri * 'Entity -> bool (requires 'Entity : null)
Public Function TryGetEntity(Of TEntity As Class) (identity As Uri, ByRef entity As TEntity) As Boolean
- TEntity
The type of the entity.
- identity
- Uri
The URI of the tracked entity to be retrieved.
- entity
- TEntity
The entity to be retrieved.
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.
Product | Versions |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: