EF核心添加迁移调试 [英] EF Core Add Migration Debugging

查看:164
本文介绍了EF核心添加迁移调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用断点进入 OnModelCreating ,看看我的逻辑是否错误,或者 ModelBuilder 是否正确做我没想到的事情?我看过很多关于如何调试实际迁移的文章,但是没有关于如何观察模型代码生成方式的文章。

How can I step into OnModelCreating with a breakpoint and see if my logic is wrong or if the ModelBuilder is doing something I'm not expecting? I've seen lots of posts on how to debug the actual migration, but nothing on how to watch how the model code is being generated.

我正在尝试实现我某些实体上的一些自定义属性,被忽略了;我想看看我的配置在生成模型代码时正在做什么。

I'm trying to implement some custom attributes on some of my entities, and it's being ignored; I'd like to see what my configuration is doing as it's generating the model code.

推荐答案

您应该可以调用 Debugger.Launch()在您的代码中。即时调试器在到达该行时会提示您附加调试器。

You should be able to call Debugger.Launch() in your code. The just-in-time debugger should prompt you to attach a debugger when it hits that line.

这篇关于EF核心添加迁移调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆