Delen via


DataObjectIdentifierResolver.ContractIdentifier Method

Contracts an identifier for a data object with the specified type and complete identifier and an indication whether or not any cached contraction should be updated.

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Public Overridable Function ContractIdentifier ( _
    typeName As String, _
    fullIdentifier As Object(), _
    refresh As Boolean _
) As Object()
public virtual Object[] ContractIdentifier(
    string typeName,
    Object[] fullIdentifier,
    bool refresh
)
public:
virtual array<Object^>^ ContractIdentifier(
    String^ typeName, 
    array<Object^>^ fullIdentifier, 
    bool refresh
)
abstract ContractIdentifier : 
        typeName:string * 
        fullIdentifier:Object[] * 
        refresh:bool -> Object[] 
override ContractIdentifier : 
        typeName:string * 
        fullIdentifier:Object[] * 
        refresh:bool -> Object[] 
public function ContractIdentifier(
    typeName : String, 
    fullIdentifier : Object[], 
    refresh : boolean
) : Object[]

Parameters

  • typeName
    Type: System.String

    The name of a type of data object.

  • fullIdentifier
    Type: array<System.Object[]

    A full identifier of a data object.

  • refresh
    Type: System.Boolean

    An indication whether any cached contraction should be updated.

Return Value

Type: array<System.Object[]
Returns the partial, contracted unique identifier for a data object.

Exceptions

Exception Condition
ArgumentNullException

The typeName parameter is null.

Remarks

Use this method to take a full identifier and convert it to the smallest possible identifier that still uniquely identifies the object. For example on SQL Server, when connected as user dbo to the database pubs, a full identifier "pubs.dbo.authors" can be contracted to the simpler form, "authors".

The refresh parameter indicates whether the method should update its cache to reflect the current data source context. This is most likely necessary if the data source context changes during the lifetime of a connection.

Normally a data provider would not override this method directly. The base implementation makes calls into the QuickContractIdentifier and possibly the SlowContractIdentifiermethod, depending on cache state.

.NET Framework Security

See Also

Reference

DataObjectIdentifierResolver Class

Microsoft.VisualStudio.Data Namespace

QuickExpandIdentifier

SlowExpandIdentifier