Hi all,
I have a generic method (in a non generic class) returning elements.
public IEnumerable<T> GetElements<T>() where T : class
{
foreach (Element element in elements)
{
if (element is T)
{
yield return element as T;
}
}
}
I want to transform this function in a getter method and tried something like
public IEnumerable<T> Elements<T>
{
get
{
foreach (Element element in elements)
{
if (element is T)
{
yield return element as T;
}
}
}
}
This does not compile: ( expected
Some one knows what the problem is here?
thanks