Hi,
I'm working with a product called SiteFinity.
I have a class which looks like so:
public class Categories
{
public IContent oContent {get; set;}
}
I'm then looping through a list and trying to check whether the current value already exists, like so:
IList items = base.CreateDataSource();
IList filteredList = new List<string>();
foreach (IContent cnt in items)
{
if (!filteredList.Contains(cnt))
{
filteredList.Add(cnt);
}
}
return filteredList;
But this returns an error. Am i using the .Contains correctly?
Update:
Ok I have updated:
List<IContent> filteredList = new List<IContent>();
However, IContent has a method that can be called to extract further information, which is like so:
foreach(IContent cnt in items)
{
string strCat = cnt.GetMetaData("Category");
}
Now although i want filteredList to contain multiple IContent items, I want to check against the string GetMetaData before deciding whether the item should be added. Does that make sense?
Thanks.