开发者

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

开发者 https://www.devze.com 2022-12-14 01:10 出处:网络
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 n

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

精彩评论

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