Is there a particular reason you are using `yield return` as opposed to simply `return`? A method using `yield return` must be declared as returning one of the following two interfaces:
`IEnumerable` or `IEnumerator`
*Example:*
public IEnumerable YourMethod() {
foreach (XElement header in headersXml.Root.Elements()) {
yield return (ParseHeader(header));
}
}
So there is a difference between `return` and `yield return`, and you need to declare the method correctly.
↧