Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think you should write: </p> <pre><code>var sortedList = from a in _assignmentControls join p in _priceLevels on a.ID equals p.ID orderby p.AnotherValue select a; </code></pre> <p>When you write from a in _assignmentControls - you are declaring a variable that refers to current element in a sequance that the operation to be performed on. And when you're calling select - you're projecting element from the sequence. Imagine it like conveyer.</p> <p>Let me give you some example with dump data:</p> <pre><code>public class SomeCLass { public int ID { get; set; } public string Name { get; set; } } public class AnotherClass { public int ID { get; set; } public int Value { get; set; } public int AnotherValue { get; set; } } public void TestMEthod() { List&lt;SomeCLass&gt; _assignmentControls = new List&lt;SomeCLass&gt;() { new SomeCLass() { ID = 1, Name = "test"}, new SomeCLass() { ID = 2, Name = "another test"} }; List&lt;AnotherClass&gt; _priceLevels = new List&lt;AnotherClass&gt;() { new AnotherClass() {ID = 1, AnotherValue = 15, Value = 13}, new AnotherClass() {ID = 2, AnotherValue = 5, Value = 13} }; var sortedList = //here you're declaring variable a that will be like caret when you going through _assignmentControls from a in _assignmentControls join p in _priceLevels on a.ID equals p.ID orderby p.AnotherValue select a; foreach (var someCLass in sortedList) { Console.WriteLine(someCLass.Name); } } </code></pre> <p>Result: </p> <pre><code>another test test </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload