Click here to Skip to main content
11,582,849 members (68,847 online)
Rate this: bad
good
Please Sign up or sign in to vote.
I think i am doing this wrong, so please bear with me. I am working on asp mvc4 project. I want to add a entity framework to the project. So i presume i add it to the data models folder(it is generated from a database in my sql express). Now i want to create a DataAccess Class to read and write to the database using the DatabaseEntities Class, i put this class in the model folder. But in order to use this class i have to be able to reference the model itself. How do i do this, i try putting 'using project.' ? , no Data Model option! So either i am putting the DataAccess Class or the Model in the wrong place or i have totally missed something or done something totally wrong?
Posted 31-Jan-13 10:00am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The solution is to ad the edmx to the models folder and use a code generator to generate the classes and data context. However now i have a new problem in that when i go to add a controller it does not see my data context?!
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 315
1 Sergey Alexandrovich Kryukov 220
2 Andy Lanng 124
3 virusstorm 119
4 Kornfeld Eliyahu Peter 100
0 OriginalGriff 1,403
1 Sergey Alexandrovich Kryukov 970
2 Abhinav S 696
3 F-ES Sitecore 505
4 Suvendu Shekhar Giri 503


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100