NHibernate Eager Fetching Over Multiple Levels

后端 未结 5 1900
野的像风
野的像风 2020-12-12 22:53

I have a 3-leveled hierarchy of entities: Customer-Order-Line, which I would like to retrieve in entirety for a given customer, using ISession.Get(id). I have the following

5条回答
  •  孤城傲影
    2020-12-12 23:44

    I just read Ayende's Blogpost where he used the following Example:

    session.CreateCriteria(typeof(Post))
        .SetFetchMode("Comments", FetchMode.Eager)
        .List();
    

    In a Criteria Query to avoid Lazy Loading on one particular Query

    Maybe that can help you.

提交回复
热议问题