title: C# get filtered list of objects based on derived type
body: <p>I'm creating an item system for a game. I am trying to store all items in a single <code>List&lt;Item&gt;</code> in my <code>ItemDatabase</code> class and then pull items that are a specific subclass of type <code>Item</code>. Items drawn in my editor are filtered based on the type of items they are and displayed on their appropriate pages. I can not figure out the LINQ query to get this to work.</p>
  
  <pre><code>interface IItem
  {
      string Name { get; set; }
  }
  
  //need to do this because I cannot serialize interface in Unity3D.
  class Item : IItem 
  {
      public string Name { get; set; }
  }
  
  class WeaponItem : Item 
  {
      //stuff
  }
  
  class ItemDatabase
  {
      public List&lt;Item&gt; Items { get; set; }
  }
  
  class ItemEditor
  {
      void SomeMethod()
      {
          var items = ItemDatabase.Items;        
          List&lt;Item&gt; filteredItems = //some way of getting all WeaponItem objects in items list. 
      }
  }
  </code></pre>