Tuesday, 3 September 2013

Linq data structuring

Linq data structuring

Gentlemen,
I have two issues I'm struggling with LINQ. I appreciate if you could
advise. I have 2 lists rawStates (storing rows of
entity-downtime-uptime-eventtype) and rawData list storing products' in
and out times from entity.
(1) I want to select those elements from rawStates that occurred when
still waiting for that entity to be processed
foreach(var t in rawData) var s = rawStates.Where(o=>o.Entity == t.Entity
&& o.DownDate > t.InTime && o.Update
(2) If I group my rawData by productID (there are multiple rows with same
ProductID), how can I revert back this "s" to these groups so that for a
productID I can group by eventtype, and summarise durations by productID?
Thanks in advance.

No comments:

Post a Comment