ContextConfiguration ContextConfiguration ContextConfiguration ContextConfiguration Class

定義

提供資料內容執行個體 (Instance) 的資訊,以便於允許自訂。Provides information for a data-context instance in order to allow customization.

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

範例

下列範例示範如何使用ContextConfiguration類別,在您呼叫RegisterContext以便啟用 scaffolding 中註冊資料內容的方法。The following example shows how to use the ContextConfiguration class when you call the RegisterContext method in order to register a data context with scaffolding enabled.

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類別可讓您自訂的資料存取。The ContextConfiguration class enables you to customize data access. 例如,您可以使用這個類別,即可啟用 scaffolding Web 應用程式,或定義自訂的中繼資料提供者。For example, you can use this class to enable scaffolding for a Web application, or to define a custom metadata provider.

建構函式

ContextConfiguration() ContextConfiguration() ContextConfiguration() ContextConfiguration()

初始化 ContextConfiguration 類別的新執行個體。Initializes a new instance of the ContextConfiguration class.

屬性

MetadataProviderFactory MetadataProviderFactory MetadataProviderFactory MetadataProviderFactory

取得或設定中繼資料提供者 (Provider)。Gets or sets the metadata provider.

ScaffoldAllTables ScaffoldAllTables ScaffoldAllTables ScaffoldAllTables

取得或設定值,這個值表示是否啟用 Scaffolding。Gets or sets a value that indicates whether scaffolding is enabled.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於