Skip to content

Instantly share code, notes, and snippets.

@mahizsas
Forked from wullemsb/SqlFunctionsSample.cs
Created June 19, 2013 13:24
Show Gist options
  • Save mahizsas/5814302 to your computer and use it in GitHub Desktop.
Save mahizsas/5814302 to your computer and use it in GitHub Desktop.
var chartData = from log in _contextProvider.Context.Logs
group log by new
{
ApplicationName=log.Application.Name,
Year= SqlFunctions.DatePart("Year", log.Timestamp),
Month= SqlFunctions.DatePart("Month",log.Timestamp)
}
into logsPerApplication
select new
{
Count = logsPerApplication.Count(),
logsPerApplication.Key.ApplicationName,
logsPerApplication.Key.Year,
logsPerApplication.Key.Month
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment