2011-06-29 107 views
1

in cakephp我可以设置链接在一起的模型。例如,我可以有相关的表的数据库如下,.net链接模型

表:人民(ID,姓名,owesMeMoneyFlag)
表:汽车(ID,people_id,品牌,颜色)。

那么我可以代码

$person = Peoples::findByName("theTod"); 
// this will only grab the cars that belond to "theTod" 
// the join is done automatically 
$cars = $person->Cars->find('All'); 
// this will only grab the blue cars that belong to "theTod" 
// findByColor method is made automatically 
$cars = $person->Cars->findByColor("blue"); 

我的问题是:有没有这样的事在.NET(我将使用ASP MVC3 C#)?如果还有智能感知的支持,那将会很整洁。

+0

你应该真的标记答案...我更喜欢我的...但我们需要时间来帮助你,请给予你认为最有帮助的一点。 – CrazyDart

回答

0

实体框架(EF 4.0)与Linq。

您正在查找ORM。那些与我一起工作的人会做EF,NHibernate,Linq to SQL和Subsonic。还有更多,但不值得一提的恕我直言。如果你不能使用第一个3,就会出现问题。