src/Shared/EntityFramework/Core/Query/PlanCompiler/CodeGen.cs
// <summary>
// For each subcommand, build up a "location-map" for each top-level var that
// is projected out. This location map will ultimately be used to convert VarRefColumnMap
// into SimpleColumnMap
// </summary>
For each subcommand, build up a "location-map" for each top-level var that
is projected out. This location map will ultimately be used to convert VarRefColumnMap
into SimpleColumnMap
For each subcommand build up a " location - map " for each top - level var that is projected out . This location map will ultimately be used to convert VarRefColumnMap into SimpleColumnMap
private Dictionary<Var, KeyValuePair<int, int>> BuildVarMap()
        {
            var varMap =
                new Dictionary<Var, KeyValuePair<int, int>>();
            var commandId = 0;
            foreach (var subCommand in m_subCommands)
            {
                var projectOp = (PhysicalProjectOp)subCommand.Op;
                var columnPos = 0;
                foreach (var v in projectOp.Outputs)
                {
                    var varLocation = new KeyValuePair<int, int>(commandId, columnPos);
                    varMap[v] = varLocation;
                    columnPos++;
                }
                commandId++;
            }
            return varMap;
        }
private Dictionary < Var , KeyValuePair < int , int > > BuildVarMap ( ) { var varMap = new Dictionary < Var , KeyValuePair < int , int > > ( ) ; var commandId = 0 ; foreach ( var subCommand in m_subCommands ) { var projectOp = ( PhysicalProjectOp ) subCommand . Op ; var columnPos = 0 ; foreach ( var v in projectOp . Outputs ) { var varLocation = new KeyValuePair < int , int > ( commandId , columnPos ) ; varMap [ v ] = varLocation ; columnPos ++ ; } commandId ++ ; } return varMap ; }
For each subcommand, build up a "location-map" for each top-level var that
is projected out.
For each subcommand build up a " location - map " for each top - level var that is projected out .