Skip to content

Instantly share code, notes, and snippets.

@naveensrinivasan
Created June 17, 2015 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naveensrinivasan/213c2092babc23d7c772 to your computer and use it in GitHub Desktop.
Save naveensrinivasan/213c2092babc23d7c772 to your computer and use it in GitHub Desktop.
Duration I have done yoga grouped by date.
var items = JsonConvert.DeserializeObject<PraticeHistory>(result);
items.history.Select (h => new { WatchedDate =epoch.AddSeconds( h.date_watched_timestamp).ToLocalTime(),
h.video.category, Duration = Convert.ToInt32( h.video.durationMin), h.video.level, h.video.short_description,
h.video.style, h.video.title })
.GroupBy (h => h.WatchedDate.ToShortDateString())
.Select (h => new {h.Key, Duration = h.Select (x => x.Duration)})
.Aggregate ((x,y) => x+y)} )
.Dump();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment