Eager Loading Using Fluent NHibernate/Nhibernate & Automapping

前端 未结 4 512
萌比男神i
萌比男神i 2020-12-13 19:34

I have a requirement to load a complex object called Node...well its not that complex...it looks like follows:-

A Node has a refere

4条回答
  •  無奈伤痛
    2020-12-13 19:47

    each mapping has to have lazy loading off

    in Node Map:

    Map(x => x.EntityType).Not.LazyLoad();
    

    in EnityType Map:

    Map(x => x.Properties).Not.LazyLoad();
    

    and so on...

    Also, see NHibernate Eager loading multi-level child objects for one time eager loading

    Added:

    Additional info on Sql N+1:

    http://nhprof.com/Learn/Alerts/SelectNPlusOne

提交回复
热议问题