Given a database schema, programmatically generate EF source code
We have a project driven by database design. And when someone makes a db modification, I would like to have my EF code updated. So, I was wondering if there is a way to programmatically generate EF source code given a database connection string. I then plan on attaching this generated EF source code to my solution. I don't need an exact solution right now, but if anyone can point me in the right direction, that would be great.
You could query the SQL Server system tables and generate code that way, perhaps using XML and XSLT or T4 templates.
There are three approaches to Entity Framework Development: Database First, Model First, and Code First. You are using Database first.
I recomend Julia Lerman's book Programming Entity Framework 2nd Edition.
The tutorial I've linked to is for Code First but it has a nice introduction to Repository and Unit Of Work Patterns which you will want to know when using any of the three approaches.