EF Core 添加迁移调试

编程入门 行业动态 更新时间:2024-10-15 02:30:14
本文介绍了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 添加迁移调试

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

发布评论

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

>www.elefans.com

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