1. <i id='kxetv'><tr id='kxetv'><dt id='kxetv'><q id='kxetv'><span id='kxetv'><b id='kxetv'><form id='kxetv'><ins id='kxetv'></ins><ul id='kxetv'></ul><sub id='kxetv'></sub></form><legend id='kxetv'></legend><bdo id='kxetv'><pre id='kxetv'><center id='kxetv'></center></pre></bdo></b><th id='kxetv'></th></span></q></dt></tr></i><div id='kxetv'><tfoot id='kxetv'></tfoot><dl id='kxetv'><fieldset id='kxetv'></fieldset></dl></div>
      <tfoot id='kxetv'></tfoot>
      <legend id='kxetv'><style id='kxetv'><dir id='kxetv'><q id='kxetv'></q></dir></style></legend>

      <small id='kxetv'></small><noframes id='kxetv'>

          <bdo id='kxetv'></bdo><ul id='kxetv'></ul>
      1. 我可以先使用 EF 代码和 .net 核心生成迁移脚本吗

        Can I generate script of a migration with EF code first and .net core(我可以先使用 EF 代码和 .net 核心生成迁移脚本吗)
          <bdo id='ULCYG'></bdo><ul id='ULCYG'></ul>

          <small id='ULCYG'></small><noframes id='ULCYG'>

                <tbody id='ULCYG'></tbody>
            1. <tfoot id='ULCYG'></tfoot>
              • <i id='ULCYG'><tr id='ULCYG'><dt id='ULCYG'><q id='ULCYG'><span id='ULCYG'><b id='ULCYG'><form id='ULCYG'><ins id='ULCYG'></ins><ul id='ULCYG'></ul><sub id='ULCYG'></sub></form><legend id='ULCYG'></legend><bdo id='ULCYG'><pre id='ULCYG'><center id='ULCYG'></center></pre></bdo></b><th id='ULCYG'></th></span></q></dt></tr></i><div id='ULCYG'><tfoot id='ULCYG'></tfoot><dl id='ULCYG'><fieldset id='ULCYG'></fieldset></dl></div>
              • <legend id='ULCYG'><style id='ULCYG'><dir id='ULCYG'><q id='ULCYG'></q></dir></style></legend>

                  本文介绍了我可以先使用 EF 代码和 .net 核心生成迁移脚本吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 .Net Core 构建 MVC 应用程序,我需要生成迁移脚本.

                  I'm building a MVC application with .Net Core and I need to generate the script of a migration.

                  使用 EF6 我确实运行了命令

                  With EF6 I did run the command

                  update-database -script
                  

                  但是当我尝试对 .net Core 做同样的事情时,会抛出下一个异常:

                  but when I try to do the same with .net Core is throwing the next exception:

                  更新数据库:找不到与参数匹配的参数名称'脚本'

                  Update-Database : A parameter cannot be found that matches parameter name 'script'

                  你知道是否有 EF Core 的等价物吗?

                  Do you know if there is an equivalent for EF Core?

                  推荐答案

                  根据 EF 文档 你可以使用 Script-Migration 命令.

                  As per EF documentation you can use Script-Migration command.

                  如果您只想编写所有迁移的脚本,您可以像这样从包管理器控制台调用它.如果您只想编写上次迁移的更改脚本,可以这样调用它:

                  If you want to just script all the migrations you can simply call it from Package Manager console like that. If you want to just script the changes from the last migration you can call it like this:

                  Script-Migration -From <PreviousMigration> -To <LastMigration>
                  

                  请务必查看文档,该命令还有更多选项.

                  Be sure to check the docs, there're a few more options to the command.

                  这篇关于我可以先使用 EF 代码和 .net 核心生成迁移脚本吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)
                  CreateDelegate with unknown types(具有未知类型的 CreateDelegate)
                  Does Funclt;Tgt;.BeginInvoke use the ThreadPool?(Funclt;Tgt;.BeginInvoke 使用线程池吗?)
                  How to create a delegate to an instance method with a null target?(如何为具有空目标的实例方法创建委托?)

                    • <legend id='ahjAK'><style id='ahjAK'><dir id='ahjAK'><q id='ahjAK'></q></dir></style></legend>

                        <tbody id='ahjAK'></tbody>

                      1. <small id='ahjAK'></small><noframes id='ahjAK'>

                        <tfoot id='ahjAK'></tfoot>
                        • <bdo id='ahjAK'></bdo><ul id='ahjAK'></ul>
                            <i id='ahjAK'><tr id='ahjAK'><dt id='ahjAK'><q id='ahjAK'><span id='ahjAK'><b id='ahjAK'><form id='ahjAK'><ins id='ahjAK'></ins><ul id='ahjAK'></ul><sub id='ahjAK'></sub></form><legend id='ahjAK'></legend><bdo id='ahjAK'><pre id='ahjAK'><center id='ahjAK'></center></pre></bdo></b><th id='ahjAK'></th></span></q></dt></tr></i><div id='ahjAK'><tfoot id='ahjAK'></tfoot><dl id='ahjAK'><fieldset id='ahjAK'></fieldset></dl></div>