I have a list variable that is a List >.
She has 108 items.
The Matrix [0] list looks like this:
What I wanted was for the variable ListMatrix to come only with the items in the Matrix list whose COD_OCUPACAO = 1 & COD_NIVEL = 1
I have tried in several ways, eg:
var listaMatrizFiltrada = listaMatriz.GroupBy(i => i.ElementAt(0).Value == 1 && i.ElementAt(4).Value == 1).Where(group => @group.Any()).Select(g => g.First()).ToDictionary(kvp => kvp.Keys, kvp => kvp.Values);
But it did not filter correctly. This code I found on the internet, but I still do not understand exactly how each section (GroupBy, Where, etc.) works.