Reverse engineering the existing database to you datalayer

With the new Entity Framework tools for VisualStudio 2012 or 2013 it is possible to create a Code First datamodel from Database. This option will look at your database and create all the necessary POCO classes and the DataContext file.

But what if you don't work with VisualStudio2012 or don't want to install the Entity Framework tools?

Well you just create your DataContext file like this and after that create a test-project. In this project create a new Entity Data-Model. Point to you database and it will create all the POCO classes you need to have in the CodeFirst datalayer project. Just copy the POCO classes over to your existing project, rename the namespaces etc. and you're done!





Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!