title: Group by using the Entity Framework
body: <p>I receive 48 files per day on a half hourly basis from market. These files have a start time as a property. I am using Entity Framework to view these files in a web application and as the files have a UK time but I am working with a european market the trading day begins the day before at 11pm and so I want to group these together based on the trading day.</p>
  <p>In SQL I can accomplish this by:</p>
  <pre><code>select cast(DATEADD(hour, 1, START_TIME) as date), count(cast(START_TIME as date)) 
  from imbalancecost
  group by cast(DATEADD(hour, 1, START_TIME) as date)  
  </code></pre>
  <p>I am trying to achieve a similar result in C# using the following attempt:</p>
  <pre><code>IEnumerable&lt;IGrouping&lt;DateTime, ImbalanceCost&gt; imbalanceCost = db.ImbalanceCost.GroupBy(ic =&gt; ic.START_TIME).ToArray();
  </code></pre>
  <p>Is there any means of first adding the hour onto my grouping and then using only the date part of this new calculated value?</p>