Linq-Ausdruck zu finden, der max-Wertes einer Liste - <List<int>>?

Ist es eine Coole Linq-Ausdruck zu finden, der max int-Wert in ein List<List<int>>?

Derzeit tun:

int maxValue = 0;
foreach(List<int> valueRow in values)
{
    //linq expression to get max value
    int value = valueRow.OfType<int>().Max(); 
    if (value > maxValue)
    {
        maxValue = value;
    }
}

InformationsquelleAutor Seth | 2011-06-17

Schreibe einen Kommentar