MetaModel.Default Property

 

Gets the first instance of a data model that is created by the application.

Namespace:   System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)

Public Shared Property Default As MetaModel
	Get
	Friend Set
End Property

Property Value

Type: System.Web.DynamicData.MetaModel

The data-model instance.

This property provides a simple way to reference the default data-model instance. If the application uses multiple models, you must provide your own way to store references to the additional data models. To find a specific data model, call the M:System.Web.DynamicData.MetaModel.GetModel method.

The following example shows how to use the Default property in the GetModel method to get the default data model.

For a complete example, see the MetaModel class overview.

' Get the data model. 
Public Function GetModel(ByVal defaultModel As Boolean) As MetaModel
    Dim model As MetaModel

    If defaultModel Then
        model = MetaModel.[Default]
    Else
        model = MetaModel.GetModel(GetType(AdventureWorksLTDataContext))
    End If
    Return model
End Function

.NET Framework
Available since 3.5
Return to top
Show: