title: Return the Sum() of a query, using LinQ and Lambda Expression
body: <p>I have this generic method in my repository for searching</p>
  
  <pre><code>public virtual IEnumerable&lt;TEntity&gt; Search(Expression&lt;Func&lt;TEntity, bool&gt;&gt; predicate)
  {                
       return Dbset.Where(predicate);
  }
  </code></pre>
  
  <p>And this one that searches all the Disable records of my entity</p>
  
  <pre><code>public IEnumerable&lt;CodigosDeOperacao&gt; GetDisabled()
  {
       return Search(c =&gt; !c.Active &amp;&amp; c.disabled).OrderBy(c=&gt;c.Code);
  }
  </code></pre>
  
  <p>I would like to return the number of disabled, because I will need to know if it equals zero.</p>
  
  <p>So I created this method.</p>
  
  <pre><code>public CodigosDeOperacao GetTheAmmountOfDisable()
  {
       //somthing like taht
       return Search(c=&gt;c.Ativo).Sum();
  }
  </code></pre>
  
  <p>How could I return these records using these methods using Lambda and LinQ?</p>