如何为实体框架包装.Net数据提供程序

发布于 2024-08-13 08:41:38 字数 468 浏览 3 评论 0原文

我将尝试再次解释这个问题:

我想在实体框架中引入日志记录,以便可以记录查询及其结果以及查询执行所需的时间。 Jaroslaw Kowalski 已包装提供程序以拦截实体框架与原始提供程序之间的通信。它还提供了我打算使用的跟踪工具。

我对他写的这个包装的完整性感到困惑。目前他只包装了Connection、Command、Transaction、DataReader 和ProviderFactory。我不知道实体框架与提供者通信的所有方式。我想知道实体框架使用数据提供程序的所有方式。例如,如果实体框架使用 DataAdapter 或 DataSets 等

I will try to explain the question again:

I wanted to introduce logging in Entity Framework in such way that the query and its result along with the time the query took to execute can be logged. Jaroslaw Kowalski has wrapped the provider to intercept communication between Entity Framework and the original provider. It also provides tracing facility which I am intending to use.

What I am confused about is the completeness of this wrapper that he has written. Currently he has only wrapping Connection, Command, Transaction, DataReader, and ProviderFactory. I am not aware of all the ways that Entity Framework communicates with the provider. I wanted to know all the ways with which Entity Framework can use data provider. For e.g. if Entity Framework uses DataAdapter or DataSets e.t.c.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执妄 2024-08-20 08:41:38

这里是一个简单的实体框架提供程序。
当然,如果真正的 DBMS 与 MS SQL Server 不同,您会遇到很多问题,而且即使在理论上也不是所有问题都可以解决。

Here is a simple Entity Framework provider.
Of course, in case of real DBMS different from the MS SQL Server you will meet a great number of problems, and not all of them can be solved even in theory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文