I've written a method that returns an
public IEnumerable<Row> ConvertExcelToRows(IExcelDataReader reader)
var row = new Row();
// do some work. No dynamic objects here whatsoever
yield return row;
dynamic operates by a contagion principle. If anything coming into an expression is
dynamic, then the compiler can make no guarantees at compile time about what might come out -- so what comes out is considered
dynamic as well.
Something upstream, a parameter to a method, the object you called the method on, or a term in an expression, is
dynamic. You need to find out what. An obvious candidate is
excelReader: Where did it come from, and where did that object come from? What were the parameters (if any) you gave the method, and where did you get them?
Patient Zero is out there somewhere.