I should make you aware of apps like
Linqer | SQL to LINQ converter[
^] before I continue. These types of app translate sql to linq syntax.
Here's what I got for lamda:
var results = db.CMMS
.Where(c=>c.Unit == prop1 && c.Section == prop2)
.GroupBy(c=>c.Component)
.Select(g=>new {Component = g.Key, DownTime = g.Sum(c=>c.DownTimeDownDay})
.Take(10)
Please note :
The var
result
is an ienumerable of an anonymous type
I assumed the property names as if you had used LinqToSql to link to the database
I hope that helps ^_^