如何编写标准以返回属于特定用户的所有订单?
public class User
{
[PrimaryKey]
public virtual int Id { get; set; }
}
public class Order
{
[PrimaryKey]
public virtual int Id { get; set; }
[BelongsTo("UserId")]
public virtual User User { get; set; }
}
return ActiveRecordMediator<Order>.FindAll(
// What criteria should I write here ?
);
答案 0 :(得分:0)
找到答案:
Restrictions.Eq("User.Id", userId),