EF6不使用预先生成的视图 [英] EF6 don't use pre-generated views

查看:119
本文介绍了EF6不使用预先生成的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用以下说明预先生成了视图: http://msdn.microsoft.com/zh-cn/library/vstudio/bb896240(v = vs.100).aspx
,并且已经具有 Model。项目中包含上下文和所有实体的Views.cs 文件。

I've pregenerated views using this instruction: http://msdn.microsoft.com/en-us/library/vstudio/bb896240(v=vs.100).aspx and already have Model.Views.cs file in my project with my context and all entities.

问题在于这些视图在运行时未使用。 ViewsForBaseEntitySets2F2 ... 类永远不会初始化,并且性能仍然很差。

The problem is that these views are not used at run-time. ViewsForBaseEntitySets2F2... class never gets initialized and performance is still poor.

如何强制EF使用pre-生成视图吗?

How to force EF to use pre-generated views?

如果默认情况下必须使用它(在组装中寻找 EntityViewGenerationAttribute ),那么我所做的错误以及如何诊断?

If it must use it by default (looking for EntityViewGenerationAttribute on assembly) then what I have done wrong and how to diagnose that?

UPD
我刚刚找到了 System.Data.Entity .Infrastructure.MappingViews 命名空间令人困惑。

UPD I've just found System.Data.Entity.Infrastructure.MappingViews namespace which is confusing.

此外,还有几个未解决的问题:

Also, there are several unanswered questions:

实体框架在装配中的预生成视图

ADO.NET实体框架-预先生成的视图-

如何加载Entity Framework预编译视图

推荐答案

此处是文章尚未过时的文件: http://msdn.microsoft.com/zh-cn/ data / dn469601.aspx

Here is an article which is not outdated: http://msdn.microsoft.com/en-us/data/dn469601.aspx

它将回答所有问题。

这篇关于EF6不使用预先生成的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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