I am trying to use DISTINCT on my list stationList
but it seems like I'm doing something wrong because I don't get distinct list. How would I get distinct ones in Value
where I'm setting stationList
.
foreach (StationCategory stationCategory in productCatalog.Programming.StationCategory)
{
StringBuilder stationList = new StringBuilder();
foreach (Station station in stationCategory.Station.Distinct())
{
stationList.Append(station.StationName + ",");
}
offer.FeatureList.Add(new Feature() { FeatureName = "<b>" + stationCategory.CategoryName + "</b>", Value = stationList.ToString().TrimEnd(',') });
}