替换实体框架 6 中的自跟踪实体 [英] Replacement of Self-tracking entities in Entity Framework 6

查看:43
本文介绍了替换实体框架 6 中的自跟踪实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信大多数 .NET 开发人员必须以某种方式面对这个问题.问题很简单,我正在将我的项目从 .NET 4 升级到 .NET 4.5.1.到目前为止,升级顺利进行.但是当我从 EF4 升级到 EF6 时,我确实在查询中遇到了很多错误.其中一些与我所做的重命名上下文有关,但至于与自我跟踪实体相关的错误,我有点困惑.

I am sure most of .NET developers must be facing this issue one way or the other. The problem is simple, I am upgrading my project from .NET 4 to .NET 4.5.1. So far so good the upgrade went neatly. But when I upgraded from EF4 to EF6, I did encounter lot of bugs in my queries. Some of these were related to renaming the context which I did, but as for the errors related to Self-tracking entities, I am a little confused.

自我跟踪实体是我项目的主要部分,EF6 不支持它们意味着我将不得不重写我的DAL 的主要部分.我试图找出但未能在 EF6 中找到任何替代 STE 的方法.

Self-tracking entities are a major part of my project and EF6 not supporting them means I will have to rewrite a major part of my DAL. I tried to find out but have not been able to find any alternative to STE in EF6.

有没有人知道这种情况的方法?我是否必须重写我的 STE 相关查询.答案不应包括对 Microsoft 为何决定将 STE 抛在后面的解释,因为我已经浏览了许多解释这一点的博客.

Does anyone know way around to this scenario? Will I have to rewrite my STE dependent Queries. The answers should not include explanations on why Microsoft decided to put STEs behind as I have already gone through many blogs explaining that.

推荐答案

有一个开源项目叫做Trackable Entities 为 EF6.0 中的 STE 提供支持

There is an open source project called Trackable Entities that provides support for STEs in EF6.0

这是一篇博文 将可追踪实体与 STE 进行比较.

Here is a blog post comparing Trackable Entities to STEs.

这篇关于替换实体框架 6 中的自跟踪实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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