I am trying to figure out how to select distinct values from one list and then transpose those distinct values to another list.
I have this:
Model:
public class Participant
{
public int UserId { get; set; }
public string Name { get; set; }
}
Controller Code:
List<Participant> participants = new List<Participant>();
participants = project
.QuickView
.Select(x => new Participant { x.UserId, x.FullName})
.Distinct()
.ToList();
That seems to get me the distinct values UserId and FullName but not in the List format I need. I get an IEnumerable format not List format. What am I missing to get the LINQ to place the the results in a new Participant List?