I have a function like this:
private void DropIncompleteQuarters(//what goes in here? This? IEnumerable<dynamic> gb)
{
foreach(var groupInGb in gb)
{
// What goes in here to get each element?
}
}
I am generating a Grouping like this:
histData = new List<OHLC>();
var gb = histData.GroupBy(o => new
{
Year = o.Date.Year,
Quarter = ((o.Date.Month - 1) / 3) + 1
})
.ToDictionary(g => g.Key, g => g.ToList());
I would like to pass gb to DropIncompleteQuarters, but I am not sure what the type should be.
Then inside of DropIncompleteQuarters, I would like to iterate over the items?
I suggest using named tuple instead of anonymous type. With a slight syntax change -
(...)instead of{...}you can put