Linq Nhibernate left join

后端 未结 1 733
离开以前
离开以前 2021-01-26 04:04

A Theft has an action property

This is the query i\'m trying to get NHibernate.Linq to produce:

SELECT * FROM `thefts`
LEFT JOIN memberT         


        
1条回答
  •  盖世英雄少女心
    2021-01-26 04:19

    It can't be done using the LINQ provider, but you can do it with QueryOver. Something along the lines of:

    MemberTheft memberAlias = null;
    var result = Session.QueryOver()
                        .Left.JoinQueryOver(x => x.action, () => memberAlias)
                        .Where(() => memberAlias.memberId == member.id);
    

    Edit: Updated Query.

    0 讨论(0)
提交回复
热议问题