Selecting by ID in Castle ActiveRecord

Posted by ripper234 on Stack Overflow See other posts from Stack Overflow or by ripper234
Published on 2010-04-17T09:53:34Z Indexed on 2010/04/17 10:03 UTC
Read the original article Hit count: 217

How can I write a criteria to return all Orders that belong to a specific User?

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

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about castle-activerecord