开发者

Calling a SQL Server View from EF 4.1 context object

Has anyone had experience with calling a view using EF 4.1 DBContext object? If so could you provide an e开发者_开发技巧xample. Also will this map to a POCO like a table does?

Thanks much, Derek


It should be used just like a regular table - POCO with name of the view as the table.


I have called Oracle Views using EF 4. There is one requirement to add views to edmx and that is that you need to make a primary key column in it. One way to do that is to make a column containing row numbers and make it primary. Then it would be easily added to edmx.

As far as the last part of your question is concerned, Yes they will be accessible just like other tables using dbcontext.

Hope it helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜