Not sure if the question is correct, as I'm having some trouble with what the term is for what I'm looking for exactly. Have the following data:
int? Sequence
Date theDate
int? anID
What I need to do is apply the following rules to this sequence (LINQ):
- no 2 elements which have a
Sequencehave the same non-nullanIDs. - no 2 elements have the same
theDateandanIDs if one of them has aSequence. - element N’s
theDateis more recent than element N-1stheDate. - element N’s
theDate= element N-1stheDateAND element N'sSequence> element N-1'sSequence.
How do I manage this? Do I need to use nested group by's? Will this be conditional group by's?
Am a little lost on my implementation and terminology and will update question if I get a better understanding of the solution.