从实体框架获取视图数据 [英] Get View data from Entity Framework

查看:115
本文介绍了从实体框架获取视图数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在SQL Server数据库中有一张表.我已经为该表创建了一个视图.我在项目中使用Entity Framework,并希望从视图中显示数据.

我进行了很多搜索,但找不到使用实体框架以IEnumerable形式从视图显示数据的方法.

请指导我.谢谢.

Hi,

I have a table in SQL server database. I have created a view for that table. I am using Entity Framework in my project and wish to display the data from the view.

I searched a lot but couldnt find how to display data from a view in an IEnumerable form using the Entity Framework.

Please guide me. Thanks.

推荐答案

我从这里得到了答案:
http://www.asp.网络/实体框架/教程/实体框架-aspnet--入门入门第4部分 [
I got the answer from here:
http://www.asp.net/entity-framework/tutorials/the-entity-framework-and-aspnet-–-getting-started-part-4[^]


如何尝试.如果您此时遇到与代码相关的问题,请更新问题,我们将很乐意为您提供进一步的帮助,但是直到您向我们展示代码错误或表明您已在自己的工作上付出了一些努力之前, ,我们真的无法为您提供帮助.
How about trying this. If you have issues related to the code at this point, update the question and I''ll be happy to help you further, but until you show us an error in code or something that indicates that you have put in some effort on your part, we can''t really help you.


这篇关于从实体框架获取视图数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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