且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

可以将视图映射到复杂类型

更新时间:2022-10-14 22:56:53

你应该能够将视图映射到复杂的类型。虽然截至目前我们还没有在设计器中启用此功能,但您应该可以直接在映射文件中执行此操作。


谢谢


Bindesh

SQL开发人员支持


 


[更新]


围绕这个做了一些更多的研究。只要视图具有有效密钥,设计人员似乎确实支持映射复杂类型。将视图中的一个字段标记为设计器中的一个键,然后继续将复杂类型映射到
视图。


 


Views are typically used for displaying readonly data. My question is, will future version allow me to map a view to a complex type. Complex dont have keys and so does views so they are good candidate for a result of a view. 

I want to know if this feature is something that will be added in the next version or not?


Zeeshan Hirani Entity Framework 4.0 Recipes by Apress
http://weblogs.asp.net/zeeshanhirani

You should be able to map the views to complex type. Though as of now we don't have this enabled in designer, you should be able to do this inside the mappings file directly.

Thanks

Bindesh
SQL Developer Support

 

[Updated]

Did some more research around this. It appears that the designer does support mapping the complex type as long as the view has a valid key. Mark one of the fields in the view as a key inside the designer and then go ahead and map the complex type to the view.