我有一個映射了許多關係的類。 應該爲具體用戶提取這些關係之一。流利的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
的列表。