I have two LINQ's which is below
public IEnumerable<TurbineStatus> turStatus()
{
var result1 = (from s in _db.masterData
group s by s.current_turbine_status into g
select new TurbineStatus
{
status = g.Key,
numberOfTurbines = g.Count()
}
).ToList().OrderByDescending(s => s.status);
int result12= _db.masterData.Select(s=>s.turbine_name).Count();
return result;
}
here is my TurbineStatus class:
public string status { get; set; }
public int numberOfTurbines { get; set; }
The first query returns me turbines with their status.
The second one returns me the number of all turbines.
How can I attach them together?
For example: the result1 sample query result is("RUN":2,"STOP":4,...). That means that there are 4 turbines stopped and 2 turbines are running.
The second linq(result2) returns the number of all turbines, which is an integer.