c# - EF6 Child Relations not Present in T4 on Query -


I am using Entity Framework 6, which has a beautiful bus dB using a repository pattern. EF from previous versions I had no problem regaining hair bodies as part of my Paco object. For example, if I have a customer table and account table where there is 1-N relations on DB, when I ask the customer entity, then I expect the client entity to be included in an array of account entities, like never It also does not happen, the array is always empty.

My questions are like this:

  Datacontext .set < TBL_CUSOTOMER & gt; (). Find (ID)  

Where Datacontex is inherited from DBCTNext

I'm pretty sure I'm really missing clear

Should work

  dataContext.Set & lt; TBL_CUSTOMER & gt; () .include (x => x.accounts) .FirstOrDefault (x => x.Id == ID);  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -