1

When you have the database already, what are the prons and cons of adding EF model to your project by using the following methods? By Code First to an Existing Database approach using EF Power Tools or the standard way of adding ADO.NET Entity Data Model to your project and choosing Generate From Database.

As far as I can tell these two approaches accomplish the same goal but the information in generated files is organized a bit differently.

Thanks.

sakura-bloom
  • 4,524
  • 7
  • 46
  • 61
  • 1
    Boils down to whether you prefer code or designer... – Mathieu Guindon Aug 09 '13 at 14:25
  • Duplicate? http://stackoverflow.com/questions/5446316/ef-4-1-code-first-vs-model-database-first – Will Aug 09 '13 at 14:35
  • Not exactly. I was specifically talking about the case when you have database already. And reverse engineering code first with EF Power Tools is not covered there. – sakura-bloom Aug 09 '13 at 14:46
  • 1
    It is actually a matter of preference as pointed out by @retailcoder. There is not much difference in the sense that even if you have "CodeFirst" you cannot evolve your database from the code perspective (with "real" CodeFirst you can use migrations to evolve the database if your model changes). In both cases you can have DbContext. With Power Tools you can visualize your model which will create an edmx file using `EdmxWriter` and open it in the EF Designer. – Pawel Aug 09 '13 at 19:26

0 Answers0