title: Linq summing by date in Asp.NET MVC
body: <pre><code>SiteCode    |     date      |softwarename  |  Success  |      Error
  ASZ             2017-08-5         a              1             1
  ASZ             2017-08-5         b              2             2
  ASZ             2017-08-5         a              3             3
  ASZ             2017-08-6         a              6             6
  NBL             2017-08-5         a              5             5
  </code></pre>
  
  <p><br /></p>
  
  <pre><code>var CurrentCustomer = Database.Session.Query&lt;Customer&gt;()
      .FirstOrDefault(x =&gt; x.deleted_at == null 
          &amp;&amp; x.Customer_Username == User.Identity.Name);
  
  if(CurrentCustomer != null) 
  {
      var CurrentDepValues = Database.Session.Query&lt;deployments&gt;()
          .Where(x =&gt; x.SiteCode == CurrentCustomer.SiteCode 
              &amp;&amp; x.softwarename == current_type)
          .OrderBy(x =&gt; x.date)
          .ToList();
  }
  </code></pre>
  
  <p>I have a db like that. I want to get an output like below. The same date values should be sum.</p>
  
  <pre><code>SiteCode    |     date      |softwarename  |  Success  |      Error
  ASZ             2017-08-5         a              4             4
  ASZ             2017-08-6         a              6             6
  </code></pre>