My project consist of: MVC, WEB API solution.
I have generated an ADO.NET entity data model from my database schema and it resides in the app_code folder.
I tried to access the ADO.NET entiy data model from the models folder and the controllers folder and i cannot get access to it.
Should I have the ADO.NET entity data model in the App_Code folder?
How do we access the data model from the mvc application?
Typically it is as easy as MydatabaseNameModel db = new MydatabaseNameModel(); However, it is not visible this way.
Do i need to import something in the webAPI so the MydatabaseNameModel becomes implementable?
Check that you have a using statement that points to the namespace that the EDMX is using.
or
Add a new empty project, add the model to that project, then reference the project from the MVC site (also, don’t forget the namespace)