c# - Sort child objects while selecting the parent using LINQ-to-Entities -


Imagine that you have some entity framework institutions that look like this (obviously these are not specific classes, but Autogenerated entity framework pipeline with everyone; these are for illustration purposes only):

  Generators of public class {get public ID}; Set; } Public listing & lt; Child & gt; Children {receive; Set; }} Public Class Child {Public Ent ID {get; Set; } Parent Parents {Receive; Set; } Public Integer Number {Received; Set; }}  

I have a LINQ query that looks like this:

  In the context of parents. mother-father. Include ("child") guardian  

However, it gives a list of parents where the child ID is in order I want children to have their parents within their Number to be solved by property How can this be done?

Edit: An explanation: The idea is hidden behind a method call (in the layer mask), which is only a IList & LT; Parent & gt; . This is using solutions like unknown class questions and manual sorting painful (compared to some problematic solution where you can query it or something).

Alex James discusses this issue.

In fact, relationships are considered as unorthodox, per-standard relational modeling. So you can not solve them But you can project on other collections, which can be sorted .


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -