Is there an advantage with Code First (DbContext model) vs EDMX files?
entity-framework, entity-framework-5
Solution
The main advantage is flexibility, avoid code-generation and acquire more control over how the things are made behind the scenes.
As you define the mappings in code, you've more power in terms of mapping strategies, tweaking and configuration.
In summary: your domain won't be database-driven: you've your domain model and it's the database who needs to fit it. For me, this is how should be a serious domain using a serious OR/M. OR/M makes more possible to build true object-oriented domains while they handle the pain of interoperate with a very different world, the relational model.
If you really want to have a platform-independent, neutral domain model, Code-First is the way to go.
Maybe I'm biased, but my opinion is serious, medium-to-large or great projects should start and go with Code-First. Code generation and the EDMX paradigm and this kind of sugar works if your domain isn't that complex. Once it gets complex, you need to work on your own data and domain strategies.
Problem
Our group has a DBA that manages all the databases. We started to use Code First and it's working okay. Now we have suggestions that we should be using a database first approach but as far as I am aware this requires us to do mapping in a diagram and we cannot use the Fluent API. We're happy with the idea of POCO classes so would it be best for us to just continue with Code First or is there a particular advantage (other than stored procedure use) with using EDMX files and the traditional way of working?