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
精彩评论