Distinct items of query on a list "entity framework Razor"
<pre><code>&lt;!DOCTYPE html&gt;

&lt;html&gt;



@{
PRO1.Modelo.DBMundo Datos = new PRO1.Modelo.DBMundo();
List&lt;PRO1.Modelo.Country&gt; countrylist = Datos.Country.Distinct().ToList();
List&lt;PRO1.Modelo.City&gt; citylist = Datos.City.Distinct().ToList();
}


&lt;head&gt;
&lt;meta name="viewport" content="width=device-width" /&gt;
&lt;title&gt;Paises&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Seleciona las opciones&lt;/p&gt;
&lt;p&gt;Codigo de pais&lt;/p&gt;
&lt;form name="formula1" method="post" action=""&gt;


    &lt;select name="selcodpais"&gt;
        &lt;optgroup label="prueba"&gt;
            @{

                foreach (PRO1.Modelo.Country registro in countrylist)
                {
                    &lt;option value="a"&gt;@registro.Continent&lt;/option&gt;
                }

            }
        &lt;/optgroup&gt;

    &lt;/select&gt;
    &lt;input type="submit" value="Buscar" /&gt;



     &lt;/form&gt;



     &lt;/body&gt;
     &lt;/html&gt;
</code></pre>

<p>So what im trying is to display all the items form the table on the select form, but i keep geting theese duplicates even using .Distinct(), i only want to be displayed one time per item, maybe using group by but i still dont know how to do it since im a newbie if u also have some clue or information about it i will really apreciate it
Thanks by the way</p>