2016年3月16日 星期三

[Visual Studio] Create DbContext from ERD

 Visual Studio    Entity Framework   ERD



Introduction


There are many tools for designing ERD. However, most of them are not free for personal use. Besides, how to transfer the ERD models to the real POCOs in our programming environment is another potential point.

So, using the Visual Studio to create ERD is one of the best practices. You can get the free version and it definitely has high integration on your design and development with Entity Framework.



Environment

l   Visual Studio 2015 Ent.



Lets start it!


ERD

Create a new project and add “ADO.NET Entity Data Model (EDM)” to our new project.







Now you can design the ERD!

 


POCO

Right click on the design tool and select “Add Code Generation Item” to generate POCO classes from the ERD.

 




Reference



沒有留言:

張貼留言