c# - Linq query on EF, Include() is ignored with a query that only contains a where clause -
I have the following code in my BLL which is accessed through the WCF service call:
< code> public list & lt; Despatch & gt; GetDispatchesByDateRange (date time start, date expiration, parameter string [] are included) {MyEntities entities = new MyEntities (); Var res = from institutions in D. Dispatch Where D. way. Liggs Some time (x = & gt; X. startpoint. Time of arrival & gt; = start & amp; x.startpoint.time of arrival & lt; = end || x.startpoint DepartureTime & gt; = startup & amp; Amp; x.StartPoint.DepartureTime & lt; = End || x.EndPoint.ArrivalTime & gt; = Initial & amp; amp; x.EndPoint.ArrivalTime & lt; = End || x.EndPoint.DepartureTime & gt; ; = Start & amp; X. Endpoint. Dept. Time & lt; = End) Select d; ObjectQuery & LT; Dispatch & gt; Query = Res Object & lt; Dispatch & gt; The foreach (include the string) query.Include (s); Return query. Toolist (); }The client sends anything from the side to the call, which is included in the curious load related institutions. The problem I am running in is that it is being included in it. I have read that EF will ignore which is used as part of a subquery or a projection, I am not doing it in both of these cases, selecting the entire unit based on only one condition and then adding it Includes. If I do not use the situation where it is, then it includes just fine. Is there any other situation in this situation where just adding a condition should be added in which to be ignored? This is because my 'where' can be very distant relationship that digs down in the hierarchy?
"itemprop =" text "> You can try where before the phone ()
in EF 5 It can be done as
DbQuery & lt include extension methods; Dispatch & gt; Query = entities Dispatch; Foreach (includes Var included) {query = query.Include (include); } Var res = from the DISPECH to D in ... Choose d;
Comments
Post a Comment