I have followed the Walkthrough: Creating a New ASP.NET Dynamic Data Web Site Using Scaffolding (
I have created the Dynamic Data website in Visual Studio Express 2012 without problems.
I have created the database model using the Entity Framework without problems.
I have added data using the AdventureWorks.dbml as suggested in the tutorial etc,
Where I am stuck is registering the data model for use by Dynamic Data! In the Global.asax file I have located the commented section that contains RegisterRoutes method, but no matter how hard I cross my fingers, I cannot get the thing working.
I noticed that I was using AdventureWorks2012 not the AdventureWorksLT version fo the database so changed the string to:
I have no idea what I have or have not done, but it seems unrealistically difficult for a novice to even get started? Can anyone help me get this thing configured so I can at least start to learn how to use it?
I have created the Dynamic Data website in Visual Studio Express 2012 without problems.
I have created the database model using the Entity Framework without problems.
I have added data using the AdventureWorks.dbml as suggested in the tutorial etc,
Where I am stuck is registering the data model for use by Dynamic Data! In the Global.asax file I have located the commented section that contains RegisterRoutes method, but no matter how hard I cross my fingers, I cannot get the thing working.
Code:
Public Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
' IMPORTANT: DATA MODEL REGISTRATION
' Uncomment this line to register an ADO.NET Entity Framework model for ASP.NET Dynamic Data.
' Set ScaffoldAllTables = true only if you are sure that you want all tables in the
' data model to support a scaffold (i.e. templates) view. To control scaffolding for
' individual tables, create a partial class for the table and apply the
' <ScaffoldTable(true)> attribute to the partial class.
' Note: Make sure that you change "YourDataContextType" to the name of the data context
' class in your application.
' See [URL unfurl="true"]http://go.microsoft.com/fwlink/?LinkId=257395[/URL] for more information on how to register Entity Data Model with Dynamic Data
Model.RegisterContext(GetType(AdventureWorksLT_DataModel.AdventureWorksLT_DataEntities), _
New ContextConfiguration() With {.ScaffoldAllTables = True})
' DefaultModel.RegisterContext( _
'New System.Func(Of Object)(Function() DirectCast(New YourDataContextType(), IObjectContextAdapter).ObjectContext), _
' New ContextConfiguration() With {.ScaffoldAllTables = False} _
')
Code:
Model.RegisterContext(GetType(AdventureWorks2012_DataModel.AdventureWorks2012_DataEntities), _
New ContextConfiguration() With {.ScaffoldAllTables = True})
I have no idea what I have or have not done, but it seems unrealistically difficult for a novice to even get started? Can anyone help me get this thing configured so I can at least start to learn how to use it?