简体   繁体   中英

Splitting EDMX Model

I'm looking to split my EDMX models into their own project to be referenced across the different projects without having to recreate the models across projects.

I have one project that contains the Entity Data Model. I have another project that will contain common items across the projects. This common project, I would like it to contain the Entity Models and remove them from the Entity Data Model project.

In the common project, I add an EF dbContext Generator. I change the .tt inputFile to point to the edmx file in the other project and remove the .tt file from the Entity Data Model project.

This works but how do I go about handling any changes to the Entity Data Model and carrying them over to the common project since the .tt file no longer exists?

Is there a better solution for this?

I figured it out. All I need to do is right click on the .tt file in the common model and choose 'Run Custom Tool'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM