title: Entity Framework Code Generation
body: <p>I'm trying to figure out what the best way to go would be for Entity Framework code generation with a "database first" approach. I want the complete master description of the model to be the actual database schema with annotations stored in database in tables or extended properties. Not interested in a model first or code first approach. Not opposed to writing custom code to implement if it will yield the highest quality solution. Here are some ideas:</p>
  
  <p>(1) Generate EDMX from the database. Use custom code to add annotations to the EDMX regarding uniqueness and other constraints that are not currently built in to EF. Use T4 templates to generate code from the EDMX.</p>
  
  <p>(2) Write a custom tool that generates "code first" classes from the database. No EDMX files in the solution.</p>
  
  <p>(3) Something else?</p>
  
  <p>It seems like #1 requires deeper knowledge of EF and more actual work than #2, which I am now opposed to if there are significant benefits.</p>
  
  <p>Any advice?</p>