How do I map a protected collection in Fluent NHibernate?

后端 未结 2 828
滥情空心
滥情空心 2021-01-13 10:39

I have tried using the Reveal property in Fluent but I can\'t get it to compile with a collection. I want one of my collections in an entity to be protected and not accessib

2条回答
  •  Happy的楠姐
    2021-01-13 11:08

    Assuming that Organization has a IList the

    HasMany(Reveal.Property("_trips"));

    code should work. Check that it's a property and that you have protected getters and setters (privates will not work, since NHibernate will want to proxy the collection for lazyloading).

提交回复
热议问题