共用方式為


ViewDataDictionary 建構函式

定義

多載

ViewDataDictionary(ViewDataDictionary)

根據現有的實例,初始化 類別的新實例 ViewDataDictionary

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary)

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

ViewDataDictionary(IModelMetadataProvider, Type)

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

ViewDataDictionary(ViewDataDictionary, Type)

根據現有的實例,初始化 類別的新實例 ViewDataDictionary

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type)

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

ViewDataDictionary(ViewDataDictionary, Object, Type)

根據現有的實例,初始化 類別的新實例 ViewDataDictionary 。 這個建構函式會小心避免在 為 nullmodel 擲回例外狀況 SetModel(Object)

ViewDataDictionary(ViewDataDictionary)

來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs

根據現有的實例,初始化 類別的新實例 ViewDataDictionary

public:
 ViewDataDictionary(Microsoft::AspNetCore::Mvc::ViewFeatures::ViewDataDictionary ^ source);
public ViewDataDictionary (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary source);
new Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary : Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary -> Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
Public Sub New (source As ViewDataDictionary)

參數

source
ViewDataDictionary

ViewDataDictionary 要從中複製初始值的 實例。

備註

若要在複製 ViewDataDictionary 實例時使用,且宣告的 ModelType 不會變更,例如從 ViewDataDictionary<TModel> 實例複製到基底 ViewDataDictionary 實例時。

此建構函式不應用於任何內容,其中 Model 可能會設定為與 宣告類型的 source 不相容的值。

適用於

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary)

來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs

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

public:
 ViewDataDictionary(Microsoft::AspNetCore::Mvc::ModelBinding::IModelMetadataProvider ^ metadataProvider, Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateDictionary ^ modelState);
public ViewDataDictionary (Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider metadataProvider, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState);
new Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary : Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
Public Sub New (metadataProvider As IModelMetadataProvider, modelState As ModelStateDictionary)

參數

metadataProvider
IModelMetadataProvider

IModelMetadataProvider 用來建立 ModelExplorer 實例的 實例。

modelState
ModelStateDictionary

ModelStateDictionary 這個範圍的 實例。

備註

用於建立 ViewDataDictionary 新最上層範圍的 。

適用於

ViewDataDictionary(IModelMetadataProvider, Type)

來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs

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

protected:
 ViewDataDictionary(Microsoft::AspNetCore::Mvc::ModelBinding::IModelMetadataProvider ^ metadataProvider, Type ^ declaredModelType);
protected ViewDataDictionary (Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider metadataProvider, Type declaredModelType);
new Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary : Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider * Type -> Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
Protected Sub New (metadataProvider As IModelMetadataProvider, declaredModelType As Type)

參數

metadataProvider
IModelMetadataProvider

IModelMetadataProvider 用來建立 ModelExplorer 實例的 實例。

declaredModelType
Type

Type 必須是值的 Model 。 用來設定 ModelMetadata

備註

用於為新的最上層範圍建立衍生 ViewDataDictionary 的 。

適用於

ViewDataDictionary(ViewDataDictionary, Type)

來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs

根據現有的實例,初始化 類別的新實例 ViewDataDictionary

protected:
 ViewDataDictionary(Microsoft::AspNetCore::Mvc::ViewFeatures::ViewDataDictionary ^ source, Type ^ declaredModelType);
protected ViewDataDictionary (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary source, Type declaredModelType);
new Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary : Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary * Type -> Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
Protected Sub New (source As ViewDataDictionary, declaredModelType As Type)

參數

source
ViewDataDictionary

ViewDataDictionary 要從中複製初始值的 實例。

declaredModelType
Type

Type 必須是值的 Model 。 用來設定 ModelMetadata

備註

當已知複製 ViewDataDictionary 實例和新實例的 ModelType 宣告時使用,但 Model 應該從現有的實例複製,例如從基底 ViewDataDictionary 實例 ViewDataDictionary<TModel> 複製到實例時。

如果 source.Model 不是 且 null 與 不相容,則此建構函式可能會 throwdeclaredModelType 。 傳遞 model: nullViewDataDictionary(ViewDataDictionary, Object, Type) 以忽略 source.Model

適用於

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type)

來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs

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

protected:
 ViewDataDictionary(Microsoft::AspNetCore::Mvc::ModelBinding::IModelMetadataProvider ^ metadataProvider, Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateDictionary ^ modelState, Type ^ declaredModelType);
protected ViewDataDictionary (Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider metadataProvider, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState, Type declaredModelType);
new Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary : Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary * Type -> Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
Protected Sub New (metadataProvider As IModelMetadataProvider, modelState As ModelStateDictionary, declaredModelType As Type)

參數

metadataProvider
IModelMetadataProvider

IModelMetadataProvider 用來建立 ModelExplorer 實例的 實例。

modelState
ModelStateDictionary

ModelStateDictionary 這個範圍的 實例。

declaredModelType
Type

Type 必須是值的 Model 。 用來設定 ModelMetadata

備註

用於為新的最上層範圍建立衍生 ViewDataDictionary 的 。

適用於

ViewDataDictionary(ViewDataDictionary, Object, Type)

來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs
來源:
ViewDataDictionary.cs

根據現有的實例,初始化 類別的新實例 ViewDataDictionary 。 這個建構函式會小心避免在 為 nullmodel 擲回例外狀況 SetModel(Object)

protected:
 ViewDataDictionary(Microsoft::AspNetCore::Mvc::ViewFeatures::ViewDataDictionary ^ source, System::Object ^ model, Type ^ declaredModelType);
protected ViewDataDictionary (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary source, object model, Type declaredModelType);
protected ViewDataDictionary (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary source, object? model, Type declaredModelType);
new Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary : Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary * obj * Type -> Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
Protected Sub New (source As ViewDataDictionary, model As Object, declaredModelType As Type)

參數

source
ViewDataDictionary

ViewDataDictionary 要從中複製初始值的 實例。

model
Object

屬性的值 Model

declaredModelType
Type

Type 必須是值的 Model 。 用來設定 ModelMetadata

備註

用於複製 ViewDataDictionary 實例和新實例的宣告 ModelTypeModel 已知。

如果 model 不是 且 null 與 不相容,則此建構函式可能會 throwdeclaredModelType

適用於