c# - Using EntityFramework Include with OfType -


in query need include (to avoid lazy loading) list of entities.

query.include(x => x.actionvalues.select(a => a.actionvaluedetails)); 

this works without problems in cases need eager loaded property of actionvaluedetail. actionvaluedetail base class of many other implementations of it. code looks these cases:

query.include(t => t.actionvalues.select(a => a.actionvaluedetails.oftype<actionvaluedetailspecial>().select(d => d.specialdetail))); 

but throws exception.

the include path expression must refer navigation property defined on type. use dotted paths reference navigation properties , select operator collection navigation properties.

i don't know how solve problem. using lazy-loading or projection not option me in case. need large exports ensure data loaded before we're writing stream.

any great!


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -