我有一个映射了许多关系的类。 应该为具体用户提取这些关系之一。流利的nhibernate左加入ON后期绑定,运行时值
public class Company
{
public int id { get; set; }
public string Name { get; set; }
public IList<StocksPack> stocks { get; set; }
// a lot of other properties referencing other objects
}
public class StocksPack
{
public int stockId { get; set; }
public int companyId { get; set; }
public int amount { get; set; }
public int ownerId { get; set; }
}
我如何映射stocks
是左外连接 ON stocks.companyId = company.id AND stocks.ownerId = 123456
凡实际ownerId
只在运行时已知的,在用户登录到系统后。 我想获得关于该公司的所有信息以及该公司的具体用户的Stocks
的列表。