流畅的NHibernate SQL查询有两个表

时间:2016-06-16 07:55:11

标签: c# sql nhibernate fluent-nhibernate

我的数据库中有两个表,我希望在Fluent NHibernate中查询这样的内容;

SELECT reference_detail.Label
FROM reference_detail
WHERE reference.ID=5 
INNER JOIN reference
ON reference.Section=reference_detail.Section  

这是我的课程

public class reference
{
    public virtual int ID { get; set; }
    public virtual int Section { get; set; }
    public virtual string Label { get; set; }
    public virtual int Language { get; set; }
    public virtual int RegisterID { get; set; }
    public virtual DateTime RegisterDate { get; set; }
}

public class reference_detail
{
    public virtual int ID { get; set; }
    public virtual int Section { get; set; }
    public virtual string Label { get; set; }
    public virtual int Value { get; set; }
    public virtual int Language { get; set; }
    public virtual int Sort { get; set; }
    public virtual int RegisterID { get; set; }
    public virtual DateTime RegisterDate { get; set; }
}

寻求帮助!

0 个答案:

没有答案