Hi All,
I have a item list, it contains a category. i want to group by the list using category in LINQ.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
MayankPosted Dec 9, 2016, 6:02 AM
If you need to get list of PriceLog objects:
var query = from p in PriceLogList group p by p.LogDateTime.ToString("MMM yyyy") into g select new PriceLog { LogDateTime = DateTime.Parse(g.Key), GoldPrice = (int)g.Average(x => x.GoldPrice), SilverPrice = (int)g.Average(x => x.SilverPrice) };
If it resolve your issue then mark as answer.
Manas MohapatraPosted Dec 1, 2016, 1:22 PM