src/Shared/EntityFramework/Core/Query/PlanCompiler/ColumnMapProcessor.cs
// <summary>
// Create a column map for a record type. Simply iterates through the
// list of fields, and produces a column map for each field
// </summary>
// <param name="typeInfo"> Type information for the record type </param>
// <param name="name"> column name </param>
Create a column map for a record type. Simply iterates through the
list of fields, and produces a column map for each field
Create a column map for a record type . Simply iterates through the list of fields and produces a column map for each field
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "RowType")]
        [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
            MessageId = "System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(System.Boolean,System.String)")]
        private RecordColumnMap CreateRecordColumnMap(TypeInfo typeInfo, string name)
        {
            PlanCompiler.Assert(typeInfo.Type.EdmType is md.RowType, "not RowType");
            SimpleColumnMap nullSentinelColumnMap = null;
            if (typeInfo.HasNullSentinelProperty)
            {
                nullSentinelColumnMap = CreateSimpleColumnMap(
                    md.Helper.GetModelTypeUsage(typeInfo.NullSentinelProperty), c_NullSentinelColumnName);
            }
            var properties = TypeHelpers.GetProperties(typeInfo.Type);
            var propertyColumnMapList = new ColumnMap[properties.Count];
            for (var i = 0; i < propertyColumnMapList.Length; ++i)
            {
                md.EdmMember property = properties[i];
                propertyColumnMapList[i] = CreateColumnMap(md.Helper.GetModelTypeUsage(property), property.Name);
            }
            var result = new RecordColumnMap(typeInfo.Type, name, propertyColumnMapList, nullSentinelColumnMap);
            return result;
        }
[ SuppressMessage ( " " , " " , MessageId = " " ) ] [ SuppressMessage ( " " , " " , MessageId = " " ) ] private RecordColumnMap CreateRecordColumnMap ( TypeInfo typeInfo , string name ) { PlanCompiler . Assert ( typeInfo . Type . EdmType is md . RowType , " " ) ; SimpleColumnMap nullSentinelColumnMap = null ; if ( typeInfo . HasNullSentinelProperty ) { nullSentinelColumnMap = CreateSimpleColumnMap ( md . Helper . GetModelTypeUsage ( typeInfo . NullSentinelProperty ) , c_NullSentinelColumnName ) ; } var properties = TypeHelpers . GetProperties ( typeInfo . Type ) ; var propertyColumnMapList = new ColumnMap [ properties . Count ] ; for ( var i = 0 ; i < propertyColumnMapList . Length ; ++ i ) { md . EdmMember property = properties [ i ] ; propertyColumnMapList [ i ] = CreateColumnMap ( md . Helper . GetModelTypeUsage ( property ) , property . Name ) ; } var result = new RecordColumnMap ( typeInfo . Type , name , propertyColumnMapList , nullSentinelColumnMap ) ; return result ; }
Create a column map for a record type.
Create a column map for a record type .
typeInfo
TypeInfo
Type information for the record type
Type information for the record type
name
string
None