Fluent Nhibernate left join

前端 未结 2 759
暗喜
暗喜 2021-02-07 07:53

I want to map a class that result in a left outer join and not in an innner join.

My composite user entity is made by one table (\"aspnet_users\") and an some optional p

相关标签:
2条回答
  • 2021-02-07 08:23

    Try the Optional() method.

    Join("Users", m =>
    {
      m.Optional();
      m.Map(x => x.FullName);
    });
    
    0 讨论(0)
  • 2021-02-07 08:23

    Only this did work for me (NH 3.3):

    Join("OuterJoinTable",
                    m =>
                    {
                        m.Fetch.Join().Optional();
                        m.KeyColumn("ForeignKeyColumn");
    
                        m.Map(t => t.Field, "FieldName");
                    });
    
    0 讨论(0)
提交回复
热议问题