Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to use Visual Studio better! How would I find help on the sort method?
    primarykey
    data
    text
    <p>I am reading through a book and it gives an example of the Sort Method along with a Lambda query.</p> <p>An example is <code>{Product.Sort( (x,y) =&gt; x.Name.CompareTo(y.Name) );</code></p> <p>This really took me a while to understand as I did not understand how <code>.Sort</code> was dealing with the two inputs on the lambda.</p> <p>I tried clicking on <code>Sort</code> and pressing <code>F1</code> for help, but, it didn't give anything, <a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;l=EN-US&amp;k=k%28%22SYSTEM.COLLECTIONS.GENERIC.LIST%601.SORT%22%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK,VERSION=V4.0%22%29;k%28DevLang-CSHARP%29&amp;rd=true" rel="nofollow noreferrer">that made any sense to me</a>.</p> <p>Perhaps I am just not good enough to understand those examples, but, I just could not work out how this was working until I changed the Lambda to <code>x,y,z</code> which gave the error <code>Error Delegate 'System.Comparison&lt;ConsoleApplication1.Product&gt;' does not take 3 arguments</code></p> <p>Which made a lot more sense to me... Anyway, after a while of looking around, I am confident that I understand the Sort method, but, it took me a lot longer than I am happy with.</p> <p>From people who are much better than me - given a situation like this, how would you search for help?</p> <p>By typing <kbd>Shift</kbd>+<kbd>Space</kbd>I was also able to produce the following:</p> <p><img src="https://i.stack.imgur.com/SBZco.png" alt="enter image description here"></p> <p>However, I am just wondering, as a C# learner, how can I attribute this to requiring a Lambda with two inputs?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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