title: how to use conditional sum linq c#
body: <p>What is wrong here? How to filter out negative elements correctly?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
           int[] array = { 1, 2, -3, 4, 5, -1, 4, -2 };
  
           double sumOfElem = array.Sum(element =&gt; element &lt; 0);
           Console.WriteLine(sumOfElem);
      }
  }
  </code></pre>