【问题标题】:Selecting by ID in Castle ActiveRecord在 Castle ActiveRecord 中按 ID 选择
【发布时间】:2010-04-17 09:53:34
【问题描述】:

如何编写一个条件来返回属于特定用户的所有订单?

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 ?
);

【问题讨论】:

    标签: .net nhibernate castle-activerecord orm


    【解决方案1】:

    找到答案:

    Restrictions.Eq("User.Id", userId),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多