src/Shared/EntityFramework.SqlServer/SqlGen/Sql8ExpressionRewriter.cs
// <summary>
// Adds the flattened properties on the input to the flattenedProperties list.
// </summary>
Adds the flattened properties on the input to the flattenedProperties list.
Adds the flattened properties on the input to the flattenedProperties list .
private void FlattenProperties(DbExpression input, IList<DbPropertyExpression> flattenedProperties)
        {
            var properties = input.ResultType.GetProperties();
            Debug.Assert(properties.Any(), "No nested properties when FlattenProperties called?");
            foreach (var property in properties)
            {
                var propertyInput = input;
                var propertyExpression = propertyInput.Property(property);
                if (BuiltInTypeKind.PrimitiveType
                    == property.TypeUsage.EdmType.BuiltInTypeKind)
                {
                    flattenedProperties.Add(propertyExpression);
                }
                else
                {
                    Debug.Assert(
                        BuiltInTypeKind.EntityType == property.TypeUsage.EdmType.BuiltInTypeKind
                        || BuiltInTypeKind.RowType == property.TypeUsage.EdmType.BuiltInTypeKind,
                        "The input to FlattenProperties is not of EntityType or RowType?");
                    FlattenProperties(propertyExpression, flattenedProperties);
                }
            }
        }
private void FlattenProperties ( DbExpression input , IList < DbPropertyExpression > flattenedProperties ) { var properties = input . ResultType . GetProperties ( ) ; Debug . Assert ( properties . Any ( ) , " " ) ; foreach ( var property in properties ) { var propertyInput = input ; var propertyExpression = propertyInput . Property ( property ) ; if ( BuiltInTypeKind . PrimitiveType == property . TypeUsage . EdmType . BuiltInTypeKind ) { flattenedProperties . Add ( propertyExpression ) ; } else { Debug . Assert ( BuiltInTypeKind . EntityType == property . TypeUsage . EdmType . BuiltInTypeKind || BuiltInTypeKind . RowType == property . TypeUsage . EdmType . BuiltInTypeKind , " " ) ; FlattenProperties ( propertyExpression , flattenedProperties ) ; } } }
Adds the flattened properties on the input to the flattenedProperties list.
Adds the flattened properties on the input to the flattenedProperties list .
input
DbExpression
flattenedProperties
IList<DbPropertyExpression>