I need to remove the repeated values from the list lista
and put them in another list or in the same.
Distinct()
doesn't work. listasemrepetidos
returns the same as lista
.
List<XYZr> lista = new List<XYZr>();
List<XYZr> listasemrepetidos = new List<XYZr>();
lista.Add(new XYZr(Convert.ToDouble(data[1].Replace('.', ',')), Convert.ToDouble(data[2].Replace('.', ',')), Convert.ToDouble(data[3].Replace('.', ',')), CLR));
listasemrepetidos = lista.Distinct().ToList<XYZr>();