且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

可以设置EF code首先迁移种子方法中设置断点?

更新时间:2023-02-07 14:49:32

这是不可能直接内源$ C ​​$ C,但你可以通过附加源$ C ​​$ C调试器。请参阅此链接详情:

It's not possible directly within source code but you can attach the debugger via source code. Please see this link for details:

if (System.Diagnostics.Debugger.IsAttached == false)
   System.Diagnostics.Debugger.Launch();

另一种选择将是通​​过运行源$ C ​​$ C迁移按照上面的说明:

The other option would be to run the migration via source code as explained above:

var configuration = new Configuration();
var migrator = new DbMigrator(configuration);
migrator.Update();