سؤال

If an entity is mapped with a relation to another entity as Lazy=False, but for a certain function I need to fetch them all Lazily, is that possible to do at run-time?

هل كانت مفيدة؟

المحلول

No, you can't. As commenters pointed out, you can map it as lazy and fetch eagerly, but not the other way round.

I.e. in LINQ you can fetch relationship eagerly with Fetch/FetchMany/ThenFetch/ThenFetchMany:

session.Query<Parent>()
    .Where(x => x.Name == "Ruba")
    .FetchMany(x => x.Children)
    .ThenFetch(x => x.SomethingMore);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top