Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
106 views
in Technique[技术] by (71.8m points)

c# - How do I get to all the other values of my list after I have grouped by in LINQ

How can I access any of the values not included in the groupby? Must be simple but I can't get to them.

var nextGroupedWorklist = from r in finalList
                        where r.Eprt_id.HasValue &&
                        !string.IsNullOrEmpty(r.Perceel_id)
                        group r by new { r.Eprt_id, r.Mutatie_id, r.Hermes_dossier_nr };

Only the Key's are accessible for the sake of ease the finalList is just a list of 20 or so 'columns' that I retrieved from a database.

  foreach (var item in nextGroupedWorklist )
            {
              var record = item.Key. 

I can only find the attributes after Key.

question from:https://stackoverflow.com/questions/65601836/how-do-i-get-to-all-the-other-values-of-my-list-after-i-have-grouped-by-in-linq

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...