I am trying to implement the project structure as explained in the following blog:
First i will explain my goal:
I am trying to create the following structure using EntityFramework 5
- DAL – Include the EF 5
- Model layer – include the POCO classes generated from the EF 5
- MVC Project – Presentation layer
Now, this blog explain how doing it with EF 4, but in EF 5 there is no way to cut and paste the POCO entities is a different project.
Next i would like to create Metadata classes which extend the POCO entities
I have done the following:
- Created a class project called (“DAL”) and created EF5 from database
- Created POCO entities from the edmx file
- Created a different class project called “ModelLayer”
Now my problem is that i can’t move the MyEntities.tt file from the DAL project to the “DataModel” project
Next i would like to create a Metadata classes which extend the POCO entities
Does any one succeed doing it?
If you’re using the .tt template file, at the top of the template file change the folowing line to point to your edmx file location in relative to your file structure
in my template file it’s at line 5 (VB.Net) :
My edmx file is located here :
C:!DEV\SFHD\Branches\iGEDIA_2\iGEDIA_2\SFHDDATA
My other project with the tt file is here :
C:!DEV\SFHD\Branches\iGEDIA_2\iGEDIA_2\SFHDModel\AGG\POCO
When you recompile if you’re not pointing at the right folder you’ll get an error message.
use @ before your path if you’re using c#