src/Shared/EntityFramework/Core/Query/PlanCompiler/RootTypeInfo.cs
// <summary>
// Determines the offset for structured types in Flattened type. For instance, if the original type is of the form:
// { int X, ComplexType Y }
// and the flattened type is of the form:
// { int X, Y_ComplexType_Prop1, Y_ComplexType_Prop2 }
// GetNestedStructureOffset(Y) returns 1
// </summary>
// <param name="property"> Complex property. </param>
// <returns> Offset. </returns>
Determines the offset for structured types in Flattened type. For instance, if the original type is of the form:
{ int X, ComplexType Y }
and the flattened type is of the form:
{ int X, Y_ComplexType_Prop1, Y_ComplexType_Prop2 }
GetNestedStructureOffset(Y) returns 1
Determines the offset for structured types in Flattened type . For instance if the original type is of the form : { int X ComplexType Y } and the flattened type is of the form : { int X Y_ComplexType_Prop1 Y_ComplexType_Prop2 } GetNestedStructureOffset ( Y ) returns 1
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "TypeInfo")]
        [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
            MessageId = "System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(System.Boolean,System.String)")]
        internal int GetNestedStructureOffset(PropertyRef property)
        {
            for (var i = 0; i < m_propertyRefList.Count; i++)
            {
                var nestedPropertyRef = m_propertyRefList[i] as NestedPropertyRef;
                if (null != nestedPropertyRef
                    && nestedPropertyRef.InnerProperty.Equals(property))
                {
                    return i;
                }
            }
            PlanCompiler.Assert(false, "no complex structure " + property + " found in TypeInfo");
            return default(int);
        }
[ SuppressMessage ( " " , " " , MessageId = " " ) ] [ SuppressMessage ( " " , " " , MessageId = " " ) ] internal int GetNestedStructureOffset ( PropertyRef property ) { for ( var i = 0 ; i < m_propertyRefList . Count ; i ++ ) { var nestedPropertyRef = m_propertyRefList [ i ] as NestedPropertyRef ; if ( null != nestedPropertyRef && nestedPropertyRef . InnerProperty . Equals ( property ) ) { return i ; } } PlanCompiler . Assert ( false , " " + property + " " ) ; return default ( int ) ; }
Determines the offset for structured types in Flattened type.
Determines the offset for structured types in Flattened type .
// m_propertyRefList contains every element of the flattened type // match offset of the first element of the complex type property // return something so that the compiler doesn't complain
None
property
PropertyRef
None