Dear All,
Below are easy step to split the entity classes in a separate project. I have created a MVC sample project in below example. Now follow below steps
Step 1:- Add a Ado.NET Entity Data Model as shown below. I am using SQL Server “Friends” Database in this example.
Step 2:-
Once EDMX is added I got below structure as shown in below figure. Entities for each table object of Friends Database shown in below fig
Step 3:- Now as our goal to separate this entity class I added a new class project as shown in below figure
Step 4:-
Now in this class project add EF 5.x Db Context Generator as shown in below figure
Step 5:-
Now click on Model.tt file in your new class project. Just edit the Input file as I edited in below fix you need to give your EDMX Path.
Like I did “ using string inputFile = @”..\youredmxprojectname\youredmxname.edmx”
Step 6:- Once this code is changed delete the all the entities files from EDMX and rebuild the project
Step 7:- Once the file is generated you are good to go just see as I got the files in separate class project.
I hope you will achieve the same with above steps.
So enjoy learning
Your Host,
Rajat Jaiswal