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

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

问题描述

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



自我跟踪实体是我的项目的主要部分,EF6不支持他们意味着我必须重写我的 DAL 的主要部分。我试图找出,但是在EF6中却没有找到STE的替代方案。



有没有人知道这种情况?我必须重写我的STE依赖的查询。答案不应该包括解释为什么微软决定把STE放在后面,因为我已经经历了许多博客解释说。

解决方案

有一个开源项目叫做可追溯实体,为EF6.0中的STE提供支持



这是一个 blog post 将可跟踪实体与STE进行比较。


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.

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.

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.

解决方案

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

Here is a blog post comparing Trackable Entities to STEs.

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

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