I have an iterator:
public List<int> Retrieveints(DataToEvaluate dataToEvaluate)
{
IEnumerable<int> Retrieveints()
{
if (!IsValid(dataToEvaluate.complexProperty))
{
yield return 0;
}
}
}
Do you think that I should move out the method?
public List<int> Retrieveints(DataToEvaluate dataToEvaluate)
{
return IsValid(dataToEvaluate.complexProperty, out int)
}
If you need to move await from the iterator block I would probably just do that completely, and just add the errors to a list instead, i.e.
That should be a bit simpler to read and understand.