title: SUM and DISTINCT of two different columns
body: <p>I have a table Employee with say the following records</p>
  
  <pre><code>   EmpID    Salary   Date
  
      10      2000     1/1/2011
      10      2000     2/1/2011
      20      2000     1/1/2011
  </code></pre>
  
  <p>I want to count the total number of employees and the total salary (based on some other parameters)</p>
  
  <p>Is there a easy way to write the following SQL query in entity framework. </p>
  
  <pre><code>  select Sum(Salary), count(distinct(EmployeeID)) from empdb.employeesalary (where clause)
  </code></pre>
  
  <p>Have a class into which I need to select these values</p>
  
  <pre><code>  class EmployeeEntity
    {
         decimal TotalAmount;
         int EmployeeCount 
    }
  </code></pre>
  
  <p>I currently do two queries in EF as follows </p>
  
  <pre><code>  objectcontext.employeesalary.Sum(c =&gt; c.Salary);
    objectcontext.employeesalary.Select(c =&gt; c.EmployeeID).Distinct().Count();
  </code></pre>
  
  <p>How can I merge these into a single statement using Entity Framework. Am I missing something here. </p>