title: Perform aggregate count() on ADO.net Entity data model
body: <p>I am trying to perform an aggregate count() just like a SQL query would against my database, but instead of SQL I want to use LINQ. </p>
  
  <p>I am trying to use <strong>LINQ</strong> to query my <strong>Entity Framework Data Model</strong> and perform an <strong>aggregate sum()</strong>. Specifically I want to do a count of the column(TimeWorked) in the TimeEntry table grouping by Project Name and Phase between 2 specific dates and then do a natural join on the Project table. I am then going to take that query result and load it into an observable collection and display it in a ListView.</p>
  
  <p>My desired result is [ProjectName],[Phase],[Count(TimeWorked)],[Date]
  I want to filter the counting to only Projects with a TimeEntry that is between two dates that for the sake of this example will just be called Date1 and Date2.</p>
  
  <p>I am not familiar with LINQ 100% yet, I am still learning so please excuse my lack of LINQ terminology.</p>
  
  <p>Here is a picture of my Relationship and tables.
  <a href="https://i.stack.imgur.com/lhIB2.png" rel="nofollow noreferrer">DB Schema</a></p>
  
  <p>Here are the data types
  <a href="https://i.stack.imgur.com/LWCiE.png" rel="nofollow noreferrer">Project  Table data types</a>,
  <a href="https://i.stack.imgur.com/8NSl8.png" rel="nofollow noreferrer">TimeEntry table</a></p>
  
  <p>I have been looking everywhere and can't seem to find any good resources or examples. Could someone please point me in the right direction.</p>