ContextConfiguration 類別

定義

提供資料內容執行個體 (Instance) 的資訊,以便於允許自訂。

public ref class ContextConfiguration
public class ContextConfiguration
type ContextConfiguration = class
Public Class ContextConfiguration
繼承
ContextConfiguration

範例

下列範例示範如何在呼叫 RegisterContext 方法時使用 ContextConfiguration 類別,以便向已啟用 Scaffolding 註冊資料內容。

MetaModel model = new MetaModel();
model.RegisterContext(typeof(AdventureWorksLTDataContext), 
    new ContextConfiguration() { ScaffoldAllTables = true });
Dim model As New MetaModel
model.RegisterContext(GetType(AdventureWorksLTDataContext), _
   New ContextConfiguration() With {.ScaffoldAllTables = True})

備註

類別 ContextConfiguration 可讓您自訂資料存取。 例如,您可以使用這個類別來啟用 Web 應用程式的 Scaffolding,或定義自訂中繼資料提供者。

建構函式

ContextConfiguration()

初始化 ContextConfiguration 類別的新執行個體。

屬性

MetadataProviderFactory

取得或設定中繼資料提供者 (Provider)。

ScaffoldAllTables

取得或設定值,這個值表示是否啟用 Scaffolding。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於