I have a list of objects with the following properties:
RoomName, Date, StartTime, EndTime.
I want to get a result of total hours for each Roomname, this is calulated as EndTime-StartTime.
If i have a list as:
room1 12/2/2012 11.0 12.0
room1 12/2/2012 13.0 15.0
room2 12/3/2012 11.0 12.0
When i send room1 to LINQ query i want the answer as (12.0-11.0)+(15.0-13.0) which is 3.
How can I do this using a LINQ expression?
I believe this will do grouping and calculation
Thus you store start and end time as floating-point numbers, you can simply subtract them and do calculation.