title: How to return object property from list
body: <p>I have a list of objects with properties:</p>
  
  <pre><code>public int Id { get; set; }
  public string Name { get; set; }
  </code></pre>
  
  <p>my list is:</p>
  
  <pre><code>List&lt;CategoriesList&gt; Categories { get; set; }
  </code></pre>
  
  <p>How can I write method that will return object Name with Id that I pass in parameter. How can I return this?</p>
  
  <p>Something like</p>
  
  <pre><code>return Categories.Select(x =&gt; x.Id == id).Name
  </code></pre>
  
  <p>but it don't make sense.</p>