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
Post a Comment