Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating my first dynamic data website in visual studio 2013. I select file new website and select Asp.Net Dynamic Data Entities Website. Then I add Linq to SQL Classes item. I select my tables then close. I updated the Global.asax file with the correct data context and set scaffolding to true.

VB
DefaultModel.RegisterContext( _
       New System.Func(Of Object)(Function() DirectCast(New InspDataContext(), IObjectContextAdapter).ObjectContext), _
       New ContextConfiguration() With {.ScaffoldAllTables = True} _
     )


I uncommented the code. I am getting error type IObjectContextAdapter not defined.

I am new to visual studio so try to make the answer detailed but simple.

Thanks,
Cathy
Posted
Comments
Richard Deeming 4-Aug-15 14:42pm    
Are you using "LINQ To SQL" or "Entity Framework"? The IObjectContextAdapter interface is part of Entity Framework, which is the newer and better supported framework.

Assuming you're using Entity Framework, which version are you using? The current version is v6, which will show up as a reference to an assembly called EntityFramework.dll in your project's references.

If it's v6, make sure you have the following line at the very top of your Global.asax.vb file:
Imports System.Data.Entity.Infrastructure
Member 11823189 4-Aug-15 15:07pm    
Import Namespace="System.Data.Entity.Infrastructure"
I included the above line. I get an error sayiing the the namespace System.Data.Enitity.Infrastructor cannot be found.

I am new to visual basic so I don't know how to tell if I'm running version6.

I opened a new web site in visual studio 2013 and chose the Asp.Net Dynamic Data Entities template. I then added the item, Linq to SQL class.
ZurdoDev 4-Aug-15 15:10pm    
Reply to the comment so that the user is notified instead of adding a new comment to your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900