亚音速深负荷:是否支持? [英] Subsonic Deeploads: Is This Supported?

查看:111
本文介绍了亚音速深负荷:是否支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很可能我只是在这个领域中缺少正确的本地语言,但是我正在寻找SubSonic中的特定功能.在NetTiers中,它被称为"DeepLo​​ad".一个深层的负载运行到数据库,并在一个数据库调用中获取许多对象(即,获取此OrderDetail及其所有LineItems).

It could very well be that I'm just missing the correct vernacular in this space, but I'm looking for a particular piece of functionality in SubSonic. In NetTiers it was called a "DeepLoad". A deep load runs to the database and fetches many objects (ie. fetch this OrderDetail and all of it's LineItems) in one database call.

同样,我想在建立一个可能密集的对象图或数据存储所填充的相关项目之后运行到数据存储.

Again, I want to run to the data store once an build up a potentially dense object graph or related items populated by the data store.

我如何在SubSonic中做到这一点,在SubSonic中又叫什么?

推荐答案

您可以使用带有延迟加载的IQueryable在SubSonic 3.0(尚未发布,但几乎在那里...)中做到这一点:

You can do this in SubSonic 3.0 (not yet released, but almost there...) using IQueryable with lazy loading:

var db=new NorthwindDB();
var order=db.Orders.Where(x=>.xID==20).SingleOrDefault();
Assert.Equal(3,order.OrderDetails.Count());

如果您不在3(需要.net 3.5)上,则可以使用Paul提到的Active record来做到这一点-但这会打两个电话.

if you're not on 3 (which requires .net 3.5) you can do this with Active record as Paul mentions - but it will make two calls.

这篇关于亚音速深负荷:是否支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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