nHibernate, No row with the given identifier exists

前端 未结 3 889
清歌不尽
清歌不尽 2020-12-23 17:07

I have a mapping along the lines of this.



        
3条回答
  •  庸人自扰
    2020-12-23 17:47

    Try that...

    public void Override(ModelMapper modelMapper) {
        modelMapper.Class(c => { 
            c.ManyToOne(m => m.FKObj, r => {
                r.Column("FKColumn");
                r.NotFound(NotFoundMode.Ignore); // THIS IS IMPORTANT!!!
            });
        });
    }
    

提交回复
热议问题