title: linq .Sum() not working with Short properties
body: <p>I have an object model that contains a list of objects and these objects have a property that's defined as a short. It looks somewhat like this:</p>
  
  <pre><code>public class MyObject
  {
     public short TheNumber { get; set;}
  }
  
  List&lt;MyObject&gt; TheListOfMyObjects = SomeMethodThatReturnsList();
  </code></pre>
  
  <p>Now I want to do a sum on TheNumber of all the objects in the list so I'm writing this:</p>
  
  <pre><code>var TheSum = (from a in TheListOfMyObjects 
                where....
                select a.TheNumber).Sum();
  </code></pre>
  
  <p>I get an error saying that there's no definion for Sum(). Why is this not working and how do I fix it?</p>
  
  <p>Edit:</p>
  
  <p>I have this that works:</p>
  
  <pre><code>var TheCount = (from a in TheListOfMyObjects 
                  where....
                  select a).Count();
  </code></pre>
  
  <p>So yes, I have <code>System.Linq</code> in the using statement. Not sure why the downvotes.</p>