I have a class with this structure:
public class BusinessObject
{
public int Column5 { get; set; }
public int Column6 { get; set; }
public string Column7 { get; set; }
public int Column8 { get; set; }
}
and I have this line using LINQ:
List<int> test = (from x in BusinessObjectCollection select x.Column5).Distinct().ToList();
now this works nice.. but what if I don’t know the property that the user wants the distinct values? What if all I have is a string variable that tells me which Column they want the distinct values from???
Try