MetaModel Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Instantiates a new instance of the MetaModel class.
MetaModel() |
Instantiates a new instance of the MetaModel class. |
MetaModel(Boolean) |
Instantiates a new instance of the MetaModel class. |
Instantiates a new instance of the MetaModel class.
public:
MetaModel();
public MetaModel ();
Public Sub New ()
Examples
The following example shows how to use the MetaModel constructor to perform the following tasks:
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})
Remarks
You typically call the MetaModel constructor in the Application_Start
method of the Global.asax file.
Applies to
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Instantiates a new instance of the MetaModel class.
public:
MetaModel(bool registerGlobally);
public MetaModel (bool registerGlobally);
new System.Web.DynamicData.MetaModel : bool -> System.Web.DynamicData.MetaModel
Public Sub New (registerGlobally As Boolean)
Parameters
- registerGlobally
- Boolean
true
to indicate that the model is registered globally; otherwise false
. The default is true
.
Remarks
This constructor determines whether the data model is registered globally so that it can be retrieved using the GetModel method. It enables you to create multiple models and use the same entity types while avoiding type conflicts.
You typically call the MetaModel constructor in the Application_Start
method of the Global.asax file.
Applies to
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: