ef code first - Entity Framework Projection: Materialize Additional List -
Looking at the given (simplified) object model below, give me the I am using a projection and it works fine (excepting the EF profiler, there is a lot of complaining about joining). Now let me I can accomplish my goal by reaching the Question : Can I modify my launch to return the idle without any support to the Object Model (Simplified) Materialization code It is found that , I solved the problem by making the following changes: schedule object given to the
Person , but only load the
class es taking that person.
person. There is a new requirement to also load fineness . I expected that the comment-out code will be
// FunFacts = s.Person.FunFacts, however, it is not.
schedule.FunFacts while the context is still active. However, it creates an extra round trip to the database.
schedule.FunFacts via proxy ?
Public category schedule {Public Entry ID (Receive; Set;} Public Person {Received} ;} Public list & lt; Class & gt; Classes {receive; set;}} Public class class {public id id (get; set;} public int name {get; set;}} public class insurance (Received); set;} public schedule schedule {get; set;} public notice
5, 7, 11}; Var schedule = (from sfilter (from ctx.Schedules) where s.Person.Id == desired PersonId new {Schedule = s, Person = s.Person, // FunFacts = s.Person. Choose FunFacts, Class = c from the S Classes, where select Class Ideas.Select (CID) c}). Assum Nniy () Select sFilter.Schedule). FirstOrDefault ();
FunFacts was actually selected Is not just related to the example of the
schedule Inspired by
var scheduleProjection = (from Ctx.Schedules where s.Person.Id == desired PersonId New {Schedule = s, person = s.Person, FunFacts = s.Person.FunFacts, class = c to s.Classes where classIds.Contains (c. Id) select c}) .FirstOrDefault (); Var Schedule = Schedule Projection Schedule; Schedule.FunFacts = Schedule Publishing.form;
Comments
Post a Comment