Hi, I'm having the following issue:
I'm using linq to filtrate some data in this way:
var listPerson = (from objPerson in ListPerson
select new
{
objPerson.IdPerson,
objPerson.ApePerson,
objPerson.NomPerson,
objPerson.EdadPerson,
objPerson.Gender
}).Distinct();
Everything works fine, but the problem is when i tried to cast the listPerson List to a
List<PersonClass>
How can i do that cast ? I tried:
listPerson.ToList();
But it throws an exception (cannot convert from IEnumerable to IEnumerable).
Thanks in advance. I hope i made myself clear.