EF4.0地图表 [英] EF4.0 Map Tables

查看:73
本文介绍了EF4.0地图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我很擅长使用实体框架,过去我只使用linq to sql。


我有3个表Listing,Category和ListingCategoryMap。


我通常会做类似var listing = info.ListingCategoryMap.Where(c => c.CategoryId == Id) .ToList();


当使用linq实体时,如何实现同样的目的???

解决方案

< blockquote>

我已经做了一些研究,我可以使用存储过程实现这一点,但我宁愿不要,如果我可以避免它......


如果有人谁知道如何在没有存储过程的情况下做到这一点,将非常感谢帮助。


谢谢


Im pretty new to using the entities framework, I have only been using linq to sql in the past.

I have 3 tables Listing, Category, and ListingCategoryMap.

I would usually do something like var listings = info.ListingCategoryMap.Where(c=>c.CategoryId == Id).ToList();

How can I achieve the same thing when using linq to entities???

解决方案

I have done a bit more research, and I could achieve this using stored procedures, but I would rather not if I can avoid it...

If there is anyone who knows how I can do this without the stored procs, help would be greatly appreciated.

Thanks


这篇关于EF4.0地图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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