title: How to get a custom object out of a List<> with LINQ?
body: <p><strong>In the example below, why is product null?</strong></p>
  
  <pre><code>using System.Collections.Generic;
  using System.Linq;
  
  namespace TestEventsds343
  {
      public class Program
      {
          static void Main(string[] args)
          {
              Product product = Product.LoadProduct(222);
          }
      }
  
      public class Product
      {
          public int ProductNumber { get; set; }
          public string Name { get; set; }
          public string Description { get; set; }
  
          public static Product LoadProduct(int productNumber)
          {
              List&lt;Product&gt; products = new List&lt;Product&gt;();
              products.Add(new Product { ProductNumber = 111, Name = "Intel CPU", Description = "Newest model, very fast." });
              products.Add(new Product { ProductNumber = 222, Name = "Philips Monitor", Description = "22-inch, very nice." });
              products.Add(new Product { ProductNumber = 333, Name = "Sony Camera", Description = "10 Megapixels, sharp pictures." });
  
              return products.Where(p =&gt; p.ProductNumber == productNumber) as Product;
          }
      }
  }
  </code></pre>