开发者

How to get related object in Subsonic 3 (ActiveRecord)?

Given the following:

class Customer string name end

class Order int number end

I am creating a list of orders. For each order listed, i'd like to display the开发者_如何转开发 associated customer name. is there a way to do that via the object graph, or do I have to look it up manually?

Chris


If there is a relation parent-child, Subsonic will honour it, then:

for each o as Order in orders
   Console.WriteLine(o.Customers(0).name)
next
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜