title: C# LINQ find where name is in list
body: <p>i have a List of objects and i want to sort by a certain field and then find out what "rank" or index is a certain name.</p>
  
  <p>for example, lets say i have a:</p>
  
  <pre><code>List&lt;Location&gt; Locations= new List&lt;Location&gt;();
  </code></pre>
  
  <p>and i want to sort by Popularity</p>
  
  <pre><code>var list = this.Locations.OrderBy(r =&gt; r.PopularityPct); 
  </code></pre>
  
  <p>i now want to find out what is the index of "Spain" (<strong>NOTE</strong>:  "Spain" would be a lookup of the <strong>Name</strong> property, where <strong>Name</strong> would be a property of the location object) now that this list is sorted by popularity.</p>
  
  <p>what is the easiest way of doing this?</p>