Condividi tramite


DataServiceContext.TryGetUri Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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

Syntax

'Declaration
Public Function TryGetUri ( _
    entity As Object, _
    <OutAttribute> ByRef identity As Uri _
) As Boolean
public bool TryGetUri(
    Object entity,
    out Uri identity
)

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

entity is null

Remarks

Entities in the added state are not likely to have an identity.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.