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

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

问题描述

如何使用断点进入 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 Core 添加迁移调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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