Need help with Linq filtering in C# -
I have an hour's name collection, which is composed of hour objects, two properties in an hour, employee income and hours The employees have made records in and out of punch and an hour. So at the end of a week, I have been given an hour of tilt hour items for the mill workers of DAO. It is requested that a report is made, where only one threshold is shown to the total hourly staff.
Example: A simple and flattened hourly
Id | Hours ---------- 1 | 4.5 2 6.0 3 9.9 1 5.52 2.5
The threshold is 10. In this case, I want to record only one ID record, because its salt hours are more than 10.
I know that I have a new DAO method when I return the list of hours for the first time to handle it. I can also make this very incompetence with a foreach statement, though I am trying to be better with Linq and want to see if it is possible. Thanks in advance for any help.
var filtered = timlist. Group By (H = & gt; HID). Select (g = & gt; new {id = g.c.a., hours = g.SUM (h = & gt; hhors)}). Where (H = & gt; H. Horse> = 10);
It can not be tested, but it should stop you.
Comments
Post a Comment