I cannot figure out how to correctly do this. I am getting this error on the last line of my code. The error says:
"Cannot implicitly convert type 'System.Collections.Generic.List to 'System.Collections.Generic.IEnumerator'. An explicit conversion exists (Are you missing a cast?)
Here's the code for the function:
public IEnumerator<string> AddElementsAttributesRemoveElementsAttributes()
{
List<string> retval = new List<string>();
try
{
success = false;
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
return retval;
}
How could I fix this? Do I need to somehow cast the return value to a different type?
IEnumerator<string>and not, say,IEnumerable<string>?