EF附加迁移产生空迁移

编程入门 行业动态 更新时间:2024-10-28 01:21:44
本文介绍了EF附加迁移产生空迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我加入到我的模型的新表:

I added into my model a new table:

public DbSet<ReturnedTransactions> ReturnedTransactions { get; set; }

我希望我的迁移生成的表给我,所以我所做的:

And i want my migrations to generate that table for me, so i did:

PM> Add-migration returnedTransactions

和它产生的

public partial class returnedTransactions : DbMigration { public override void Up() { } public override void Down() { } }

如何强制这件事能够生成正确的code给我吗?

How do i force this thing to generate proper code for me?

推荐答案

我只是有这个问题,我说 - 强制到Add-迁移命令和它的工作。

I just had this problem and I added -Force to the Add-Migration command and it worked.

更多推荐

EF附加迁移产生空迁移

本文发布于:2023-11-16 07:11:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1602112.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:EF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!