0
我是一個新的Castle ActiveRecord用戶,現在我發現有必要做一個涉及JOIN的選擇。我不知道如何去做。Castle ActiveRecord加入
這裏是我的兩個(樣品)類:
[ActiveRecord("Orders")]
public class Order : ActiveRecordBase<Order>
{
[PrimaryKey(PrimaryKeyType.Identity)]
public int OrderID { get; set; }
[Property]
public int UserID { get; set; }
[Property]
public DateTime OrderDate { get; set; }
[Property]
public string ShipName { get; set; }
}
[ActiveRecord("Users")]
public class UserAccount : ActiveRecordBase<UserAccount>
{
[PrimaryKey(PrimaryKeyType.Identity)]
public int UserID { get; set; }
[Property]
public string FirstName { get; set; }
[Property]
public string LastName { get; set; }
}
現在,如果我想獲得的所有訂單,與UserAccount.FirstName和UserAccount一起。姓氏,我該怎麼辦?通過閱讀,我需要創建另一個類,如「OrdersWithUserAccount」,但我不知道如何定義它。
感謝您幫助小菜!