开发者

asp.net mvc 3 view for ef4 join

开发者 https://www.devze.com 2023-04-10 05:00 出处:网络
how can i display a join fro开发者_StackOverflow社区m a entity framework model and then show it in an asp.net mvc 3 view?

how can i display a join fro开发者_StackOverflow社区m a entity framework model and then show it in an asp.net mvc 3 view? The join is then based on more than 1 model?


Create a custom view model that will hold the contents of your EF join.


you can have a view model with all the properties you want in the presentation level. It will include all the properties from all the related models. In entity framework side you can have several options.

You can have views, can map several tables for one entity, You need to give more information to give some idea about the best method. Need to know about the relationships you have in your models in EF which you are going to join.

0

精彩评论

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

关注公众号