Return Max value + name from a 2 dimensional List C#
<p>I have created a 2-dimensional list and want to return the maximum value, the minimum value, and the names that have the same index as these values.</p>

<p>This is what i did.</p>

<pre><code>class Info
{
    private string stad;
    private double temperatur;

    public string Stad
    {
        get { return stad; }
        set { stad = value; }
    }

    public double Temperatur
    {
        get { return temperatur; }
        set { temperatur = value; }
    }
}

    static double SearchMax(List&lt;Info&gt; list)
    {
        if (list.Count == 0)
        {
            throw new InvalidOperationException("Tomt Lista");
        }
        double Temperatur = double.MinValue;
        foreach (Info temperatur in list)
        {
            if (temperatur.Temperatur &gt; Temperatur)
            {
                Temperatur = temperatur.Temperatur;
            }        
        }
        return Temperatur;
    }

    static double SearchMin(List&lt;Info&gt; list)
    {
        if (list.Count == 0)
        {
            throw new InvalidOperationException("Tomt Lista");
        }
        double Tempertatur = double.MaxValue;
        foreach (Info temperatur in list)
        {
            if (temperatur.Temperatur &lt; Tempertatur)
            {
                Tempertatur = temperatur.Temperatur;
            }
        }
        return Tempertatur;
    }
</code></pre>

<p>But what I get in return is only the maximum and minimum values, not the name of the city that the temperature is in.</p>

<p>Can anyone tell me or show me how to return both?</p>

<p>Thank you for all the help you provide but it just put me back to where I was before posting this up here. What I want is for the program to return both the city and the temperature in the city
i.e "Warmest city is Oslo and it's 20 °C warm"
and not "Warmest city is consoleaplication.info"</p>

<p>edit:2
Thank you for all yours help and especialy Alex ^_^</p>
