什么时候“工作单元”不再是“单元”?哪种情况在资源上更好?第一个创建连接wheras第二创建4MVC DataContext确定是否共享一个连接
using (DataContext dc=new DataContext)
{
var orders= from o in dc.orders
select (new Product { property a= from a in ..join... select x,
property b= from b in ..join... select y,
property c= from c in ..join... select z.}
)
}
OR
using (DataContext dc=new DataContext)
{
var orders= from o in dc.orders
select (new Product { property a = GetPropertyA(),
property b = GetPropertyB(),
property c = GetPropertyC()}
)
}