I have an IEnumerable< Person> object. The Person class has a Designation proeprty.
I want to select distinct Designation values from IEnumerable< Person> and assign that to a DropDownList. How can I do it?
I have an IEnumerable< Person> object. The Person class has a Designation proeprty.
I want to select distinct Designation values from IEnumerable< Person> and assign that to a DropDownList. How can I do it?
var designations = persons.Select(p => p.Designation).Distinct();
Or:
Basic programming.