title: C# - check if list contains an object where a property equals value?
body: <p>Is there a shorthand way to do it that does not involve loops?</p>
  
  <pre><code>public enum Item { Wood, Stone, Handle, Flint, StoneTool, Pallet, Bench  }
  
  public struct ItemCount
  {
      public Item Item;
      public int Count;
  }
  
  private List&lt;ItemCount&gt; _contents;
  </code></pre>
  
  <p>so something like:</p>
  
  <pre><code>if(_contents.Contains(ItemCount i where i.Item == Item.Wood))
  {
      //do stuff
  }
  </code></pre>