How can I manage EF 6 migrations in visual studio 2015?

前端 未结 6 546
梦谈多话
梦谈多话 2021-01-04 18:24

I started a new MVC project with EntityFramework -Version 6.1.2 using Visual Studio 2013 latest update. I made a couple of migrations and updated the database.

6条回答
  •  既然无缘
    2021-01-04 19:22

    I have done a few checks, but I'll recap trying to cover all the ef scenario:

    ef7 in an asp.net 5 project: the migrations management has been changed and now is handled using the ef migration command.
    ef7 in a traditional .net application: it's required framework 4.5.1, but at this page esing ef 7 in a .net app you can find a good guide on how to use ef 7 in a traditional app. It's important to add the EntityFramework.Commands package.
    ef6: doesn't work with asp.net 5, so even you can install it, the build will be broken. Same situation for most of the actual ef drivers as the ones for mongodb and Postgresql. If you're not sure is a ef 7 compatible driver, don't install it. At the moment I think you can count just on sqlserver and inMemory.
    for asp.net 4 applications, the actual installation of the commands is part of the entity framework package itself, so will be installed at the first installation of the package (as rightly pointed out above).
    In some situations, in an environment where ef package has not been installed, copying an asp.net 4 project and starting to work on it, may give this issue, that magically disappears when for whatever reason the package is installed.

提交回复
热议问题