protected override Expression VisitColumn(DbColumnExpression column) { if (this.scope != null && this.scope.TryGetValue(column, out ParameterExpression fieldReader, out int iOrdinal)) { var method = FieldReader.GetReaderMethod(column.Type); return(Expression.Call(fieldReader, method, Expression.Constant(iOrdinal))); }
protected override Expression VisitColumn(ColumnExpression column) { ParameterExpression fieldReader; int iOrdinal; if (this.scope != null && this.scope.TryGetValue(column, out fieldReader, out iOrdinal)) { MethodInfo method = FieldReader.GetReaderMethod(column.Type); return(Expression.Call(fieldReader, method, Expression.Constant(iOrdinal))); } else { System.Diagnostics.Debug.Fail(string.Format("column not in scope: {0}", column)); } return(column); }