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 273
1 Maciej Los 255
2 Aajmot Sk 234
3 Richard MacCutchan 200
4 Marcin Kozub 195
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.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