Click here to Skip to main content
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 11: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 277
1 BillWoodruff 205
2 Maciej Los 205
3 DamithSL 165
4 Sergey Alexandrovich Kryukov 145
0 OriginalGriff 5,107
1 DamithSL 4,157
2 Maciej Los 3,595
3 Kornfeld Eliyahu Peter 3,450
4 Sergey Alexandrovich Kryukov 2,741


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2014
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