共用方式為


DataObjectIdentifierResolver.ContractIdentifier 方法

命名空間:  Microsoft.VisualStudio.Data
組件:  Microsoft.VisualStudio.Data (在 Microsoft.VisualStudio.Data.dll 中)

語法

'宣告
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[]

參數

  • typeName
    類型:String

    資料物件的型別名稱。

  • fullIdentifier
    類型:array<Object[]

    資料物件的完整識別項。

  • refresh
    類型:Boolean

    指示是否應該更新任何快取的合約。

傳回值

類型:array<Object[]
傳回部分,資料物件的壓縮以的唯一識別項。

例外狀況

例外狀況 條件
ArgumentNullException

typeName 參數為 null。

備註

使用這個方法會以完整識別項並將它轉換成唯一仍然識別物件的最小可能的識別項。 例如,在 SQL Server,則當使用者連接至 dbo pubs 資料庫,則完整的識別項「pubs.dbo.authors」可以縮小至最簡單的形式, 「Author」。

refresh 參數指出方法是否應該更新其快取反映目前資料來源的內容。 這很可能是必要的資料來源內容連接中的存留期 (Lifetime) 期間,是否已變更。

資料提供者通常不會直接覆寫這個方法。 基底實作會呼叫 QuickContractIdentifier 和可能 SlowContractIdentifier方法,根據快取狀態。

.NET Framework 安全性

請參閱

參考

DataObjectIdentifierResolver 類別

Microsoft.VisualStudio.Data 命名空間

QuickExpandIdentifier

SlowExpandIdentifier