Code First and Other ED Features?
Posted: Mon 04 May 2015 19:25
We have been using EF through several versions with SQL Server. We started with Model First since Code First was terrible early on, then Database First when Model First did not work well with views and sprocs, and now EF7 says both will be dropped so we are considering migrating to Code First in EF6 before eventually converting to EF7. Still I want a visual designer for creating and understanding relationships so am considering DevArt's Entity Developer, LLBLGen, and Sparx Enterprise Architect w/ transforms for our development team going forward.
Mainly I'm wondering if the EF7 announcment of dropping Model First and Database First has changed future plans for Entity Developer or if you plan any Code First generation and support. Some DevArt ED questions I have are -
- Can I via code specify different schema concurrently for the same DbContext? We use this technique to clone and update large tables in the background, and then swap using schema transfers and that works well and quickly. I have this working in Database First currently but it is ugly compared to how I can do this in Code First.
- Can I add my own model Data Annotation decorations to the models like I can in Code First (e.g. Max/min length, ErrorMessage, COncurrencyCheck, NotMapped, Index, Required, validation etc.)?
- Can I use multiple DbContext for the same database, each with only the needed tables and relationships, for a large database, so I don't have to define the entire infrastructure for a very small DbContext we want to run quickly? Don't want to create 100 tables and relationships just because I lookup in two related tables.
- Can I define my own partial classes? Use class and interface inheritance?
Also, do your Model First and Database First approaches "round trip"? Iow, can I switch between using DF and CF as I like on the same project as appropriate? E.G.
- Use DF for bringing in a new view
- Then use MF for defining a new table and relationship
Thanks. A prospective customer, Dave
Mainly I'm wondering if the EF7 announcment of dropping Model First and Database First has changed future plans for Entity Developer or if you plan any Code First generation and support. Some DevArt ED questions I have are -
- Can I via code specify different schema concurrently for the same DbContext? We use this technique to clone and update large tables in the background, and then swap using schema transfers and that works well and quickly. I have this working in Database First currently but it is ugly compared to how I can do this in Code First.
- Can I add my own model Data Annotation decorations to the models like I can in Code First (e.g. Max/min length, ErrorMessage, COncurrencyCheck, NotMapped, Index, Required, validation etc.)?
- Can I use multiple DbContext for the same database, each with only the needed tables and relationships, for a large database, so I don't have to define the entire infrastructure for a very small DbContext we want to run quickly? Don't want to create 100 tables and relationships just because I lookup in two related tables.
- Can I define my own partial classes? Use class and interface inheritance?
Also, do your Model First and Database First approaches "round trip"? Iow, can I switch between using DF and CF as I like on the same project as appropriate? E.G.
- Use DF for bringing in a new view
- Then use MF for defining a new table and relationship
Thanks. A prospective customer, Dave