I'm here with the problem of converting Java's HashMap foreach loop into C#'s foreach...

```
 public static Map<Genre, List<Band>> PLAYER_ATTRIBUTE_HASHMAP = load();

```

Upper I've got Java declaration of HashMap - i've convert it into this in C#:

```
public static Dictionary<Player, List<Attribute>> PLAYER_ATTRIBUTE_DICTIONARY = load();

```

It not doing any exception at the moment, but I've got another problem with lambda foreach loop on it...

In Java it looks like:

```
PLAYER_ATTRIBUTE_HASHMAP.forEach((p, a) -> attributes.addAll(a));

```

How it should look like in C#?

It can be normal foreach loop on Dictionary, but I can't understand the thing..

I've got another loop which I convert mostly, but again similar problems with C# methods from classes.

```
    attributes.AddRange(PLAYER_ATTRIBUTE_DICTIONARY.Values.SelectMany(e => e));

        //PLAYER_ATTRIBUTE_DICTIONARY.forEach((p, a)->attributes.AddAll(a));
        List<Attribute> distinctAttributes = Attribute.distinctAttributesList(attributes);
        List<Player> players = new List<Player>(PLAYER_ATTRIBUTE_DICTIONARY.keySet()); // <--- problem with keyset

        PLAYER_ATTRIBUTE_DICTIONARY.forEach((p, a)-> { // <--- and there is also..
            List<Double> encodedPlayers = new List<Double>();
            List<Double> encodedAttributes = new List<Double>();
            foreach (Player player in players)
            {
                if (player.GetName().Equals(p.GetName()))
                {
                    encodedPlayers.Add(1.0);
                }
                else
                {
                    encodedPlayers.Add(0.0);
                }
            }
            foreach (Attribute distinctAttribute in distinctAttributes)
            {
                if (a.stream().anyMatch(attribute->distinctBand.getName().equals(attribute.getName()))) // <--- there is underline with stream and anyMatch
                {
                    encodedAttributes.Add(1.0);
                }
                else
                {
                    encodedAttributes.Add(0.0);
                }
            }
            dictionary.Add(encodedPlayers, encodedAttributes);
        });
        return dictionary;
    }

```