DataServiceContext.TryGetUri Method

Retrieves the canonical URI associated with the specified entity, if available.

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

Syntax

'Declaration
Public Function TryGetUri ( _
    entity As Object, _
    <OutAttribute> ByRef identity As Uri _
) As Boolean
'Usage
Dim instance As DataServiceContext 
Dim entity As Object 
Dim identity As Uri 
Dim returnValue As Boolean 

returnValue = instance.TryGetUri(entity, _
    identity)
public bool TryGetUri(
    Object entity,
    out Uri identity
)
public:
bool TryGetUri(
    Object^ entity, 
    [OutAttribute] Uri^% identity
)
member TryGetUri : 
        entity:Object * 
        identity:Uri byref -> bool
public function TryGetUri(
    entity : Object, 
    identity : Uri
) : boolean

Parameters

  • entity
    Type: System.Object
    The entity identified by the identity.
  • identity
    Type: System.Uri%
    The URI of the entity.

Return Value

Type: System.Boolean
Returns true if the canonical URI is returned in the out parameter. If the specified entity is not tracked by the DataServiceContext or is in the added state, no URI is available and false is returned.

Exceptions

Exception Condition
ArgumentNullException

When entity is nulla null reference (Nothing in Visual Basic).

Remarks

Objects in the Added state do not yet have a URI.

See Also

Reference

DataServiceContext Class

System.Data.Services.Client Namespace