Repository: dotnet/efcore
File: src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.ExecuteUpdate.cs (C#)

Code before:
                    // returns false, we need to compose on top of it.
                    select.SetTables(newTables);
                }

                CheckColumnOnSameTable(column, propertySelector);
            }

            // Recursively processes the complex types and all complex types referenced by it, adding setters fo all (non-complex)
            // properties.
            // Note that this only handles table splitting (where all columns are flattened to the table); JSON complex types are
            // handled elsewhere.
            void ProcessComplexType(StructuralTypeShaperExpression shaperExpression, Expression valueExpression)
            {
                if (shaperExpression.StructuralType is not IComplexType complexType
                || shaperExpression.ValueBufferExpression is not StructuralTypeProjectionExpression projection)
                {
                    throw new UnreachableException();
                }

                foreach (var property in complexType.GetProperties())
                {
                    targetProperty = property;
                    var column = projection.BindProperty(property);
                    ProcessColumn(column);

                    CheckColumnOnSameTable(column, propertySelector);

                    var rewrittenValueSelector = CreatePropertyAccessExpression(valueExpression, property);
                    var translatedValueSelector = TranslateScalarSetterValueSelector(
                        source, rewrittenValueSelector, column.Type, column.TypeMapping!);

                    translatedSetters.Add(new ColumnValueSetter(column, translatedValueSelector));
                }

                foreach (var complexProperty in complexType.GetComplexProperties())
                {
                    // Note that TranslateProjection currently returns null for StructuralTypeReferenceExpression with a subquery (as
                    // opposed to a parameter); this ensures that we don't generate an efficient translation where the subquery is
                    // duplicated for every property on the complex type.
                    // TODO: Make this work by using a common table expression (CTE)

                    if (complexProperty.ComplexType.IsMappedToJson())
                    {
                        throw new InvalidOperationException(
                            RelationalStrings.ExecuteUpdateOverJsonIsNotSupported(complexProperty.ComplexType.DisplayName()));
                    }

                    var nestedShaperExpression = (StructuralTypeShaperExpression)projection.BindComplexProperty(complexProperty);
                    var nestedValueExpression = CreateComplexPropertyAccessExpression(valueExpression, complexProperty);
                    ProcessComplexType(nestedShaperExpression, nestedValueExpression);
                }

Review comment (refactor):
Redundant call to `CheckColumnOnSameTable`. This method is already called inside `ProcessColumn` at line 502, so the duplicate call at line 523 should be removed.
```suggestion

```

Code after:
                    // returns false, we need to compose on top of it.
                    select.SetTables(newTables);
                }

                CheckColumnOnSameTable(column, propertySelector);
            }

            // Recursively processes the complex types and all complex types referenced by it, adding setters fo all (non-complex)
            // properties.
            // Note that this only handles table splitting (where all columns are flattened to the table); JSON complex types are
            // handled elsewhere.
            void ProcessComplexType(StructuralTypeShaperExpression shaperExpression, Expression valueExpression)
            {
                if (shaperExpression.StructuralType is not IComplexType complexType
                || shaperExpression.ValueBufferExpression is not StructuralTypeProjectionExpression projection)
                {
                    throw new UnreachableException();
                }

                foreach (var property in complexType.GetProperties())
                {
                    targetProperty = property;
                    var column = projection.BindProperty(property);
                    ProcessColumn(column);

                    var rewrittenValueSelector = CreatePropertyAccessExpression(valueExpression, property);
                    var translatedValueSelector = TranslateScalarSetterValueSelector(
                        source, rewrittenValueSelector, column.Type, column.TypeMapping!);

                    translatedSetters.Add(new ColumnValueSetter(column, translatedValueSelector));
                }

                foreach (var complexProperty in complexType.GetComplexProperties())
                {
                    // Note that TranslateProjection currently returns null for StructuralTypeReferenceExpression with a subquery (as
                    // opposed to a parameter); this ensures that we don't generate an efficient translation where the subquery is
                    // duplicated for every property on the complex type.
                    // TODO: Make this work by using a common table expression (CTE)

                    if (complexProperty.ComplexType.IsMappedToJson())
                    {
                        throw new InvalidOperationException(
                            RelationalStrings.ExecuteUpdateOverJsonIsNotSupported(complexProperty.ComplexType.DisplayName()));
                    }

                    var nestedShaperExpression = (StructuralTypeShaperExpression)projection.BindComplexProperty(complexProperty);
                    var nestedValueExpression = CreateComplexPropertyAccessExpression(valueExpression, complexProperty);
                    ProcessComplexType(nestedShaperExpression, nestedValueExpression);
                }

                Expression CreatePropertyAccessExpression(Expression target, IProperty property)