This change will ensure models created via the EF Designer are using the EF5 NuGet package and the new DbContext API surface.

This change only affects models created in Visual Studio 11.

This change does not impact existing models or models in projects that are upgraded to Visual Studio 11.

User Experience

1) Developer creates a new EDMX file using the ‘Entity Data Model Wizard’. The model can be either empty or generated from a database.

2) Upon completion of the wizard:

  • The EDMX file is added to the project
  • The DbContext code generation templates are nested under the EDMX file
  • The EntityFramework 5.0.0 NuGet package is installed to the project

Technicals

Setup Changes:

  • EF5.0.0 NuGet packages will be dropped on disk
    • This includes the EntityFramework package plus 9 localized packages that include localized resource assemblies and IntelliSense files
    • The appropriate registry keys will be set to enable local NuGet package install
    • The DbContext code generation item templates will be installed on disk
      • This is 4 templates total (C#/VB.Net & Application/Web Site)
      • The templates will be ‘pre-unzipped’ to meet performance requirements for setup
      • These item templates will be hidden so that they don’t show up under ‘Add New Item…’
        • This avoids confusion around the templates that are available on VS Gallery
        • We need to keep the online packages for Visual Studio 2010
        • We looked into making the templates in the box look like they were installed from VS Gallery, it is possible but very complex and not a path we want to go down
  • The template will include directives to install the EF NuGet package
  • Templates will include localization to 9 languages (localization is done within the template rather than having separate localized versions)
    • The NuGet install directives will be localized so that the corresponding localized NuGet package is installed

Designer Changes:

  • The final step of the ‘Entity Data Model Wizard’ will
    • Disable the legacy ObjectContext based code generation (this legacy code generation uses SingleFileGenerator rather than tt files).
    • Trigger an install of the appropriate item template, which will in turn install the appropriate NuGet package
    • [Nice to Have] The wizard will move the two .tt files to be nested under the EDMX file
    • [Nice to Have] Using ‘Add Code Generation Item…’ to add one of the code generation templates from VS Gallery will disable the default DbContext based code generation
      • Probably the easiest way to do this is to set the ‘Custom Tool’ for the tt files to null
        • This should avoid the complexities of linked files, source control etc.

Last edited May 10, 2012 at 9:06 PM by RoMiller, version 5

Comments

No comments yet.