I have a List of items of type DataItem (List<DataItem>
):
public class DataItem
{
public DataItem() { }
public string Title { get; set; }
public string Url { get; set; }
public string Category { get; set; }
}
There may be many items with the same string in Category
field.
How can I extract a list of different possible categories using Linq?
What I want as a result is a List<string>
which has all the values found for Category
property, but doesn't have repeated values.