Repository: dotnet/efcore
File: src/EFCore.Design/Migrations/Design/CSharpSnapshotGenerator.cs (C#)

Code before:

                stringBuilder
                    .Append('.')
                    .Append("HasValue")
                    .Append('(')
                    .Append(Code.UnknownLiteral(discriminatorValue))
                    .Append(')');
            }

            stringBuilder.AppendLine(";");
        }

        var propertyAnnotations = Dependencies.AnnotationCodeGenerator
            .FilterIgnoredAnnotations(property.GetAnnotations())
            .ToDictionary(a => a.Name, a => a);

        var typeAnnotations = Dependencies.AnnotationCodeGenerator
            .FilterIgnoredAnnotations(property.ComplexType.GetAnnotations())
            .ToDictionary(a => a.Name, a => a);

        // Add ContainerColumnType annotation if complex type is mapped to JSON but the type annotation is missing
        if (typeAnnotations.ContainsKey(RelationalAnnotationNames.ContainerColumnName)
            && !typeAnnotations.ContainsKey(RelationalAnnotationNames.ContainerColumnType))
        {
            var containerColumnType = property.ComplexType.GetContainerColumnType()
                ?? Dependencies.RelationalTypeMappingSource.FindMapping(typeof(string))?.StoreType;
            if (containerColumnType != null)
            {
                typeAnnotations[RelationalAnnotationNames.ContainerColumnType] = new Annotation(
                    RelationalAnnotationNames.ContainerColumnType,
                    containerColumnType);
            }
        }

        GenerateAnnotations(
            propertyBuilderName, property, stringBuilder, propertyAnnotations,
            inChainedCall: false, hasAnnotationMethodInfo: HasPropertyAnnotationMethodInfo);

        GenerateAnnotations(
            propertyBuilderName, property.ComplexType, stringBuilder, typeAnnotations,
            inChainedCall: false, hasAnnotationMethodInfo: HasTypeAnnotationMethodInfo);
    }

    /// <summary>
    ///     Generates code for <see cref="IKey" /> objects.
    /// </summary>
    /// <param name="entityTypeBuilderName">The name of the builder variable.</param>
    /// <param name="keys">The keys.</param>
    /// <param name="primaryKey">The primary key.</param>
    /// <param name="stringBuilder">The builder code is added to.</param>
    protected virtual void GenerateKeys(

Review comment (suggestion):
@copilot Use `typeof(JsonTypePlaceholder)` here and below.

Code after:

                stringBuilder
                    .Append('.')
                    .Append("HasValue")
                    .Append('(')
                    .Append(Code.UnknownLiteral(discriminatorValue))
                    .Append(')');
            }

            stringBuilder.AppendLine(";");
        }

        var propertyAnnotations = Dependencies.AnnotationCodeGenerator
            .FilterIgnoredAnnotations(property.GetAnnotations())
            .ToDictionary(a => a.Name, a => a);

        var typeAnnotations = Dependencies.AnnotationCodeGenerator
            .FilterIgnoredAnnotations(property.ComplexType.GetAnnotations())
            .ToDictionary(a => a.Name, a => a);

        // Add ContainerColumnType annotation if complex type is mapped to JSON but the type annotation is missing
        if (typeAnnotations.ContainsKey(RelationalAnnotationNames.ContainerColumnName)
            && !typeAnnotations.ContainsKey(RelationalAnnotationNames.ContainerColumnType))
        {
            var containerColumnType = property.ComplexType.GetContainerColumnType()
                ?? Dependencies.RelationalTypeMappingSource.FindMapping(typeof(JsonTypePlaceholder))?.StoreType;
            if (containerColumnType != null)
            {
                typeAnnotations[RelationalAnnotationNames.ContainerColumnType] = new Annotation(
                    RelationalAnnotationNames.ContainerColumnType,
                    containerColumnType);
            }
        }

        GenerateAnnotations(
            propertyBuilderName, property, stringBuilder, propertyAnnotations,
            inChainedCall: false, hasAnnotationMethodInfo: HasPropertyAnnotationMethodInfo);

        GenerateAnnotations(
            propertyBuilderName, property.ComplexType, stringBuilder, typeAnnotations,
            inChainedCall: false, hasAnnotationMethodInfo: HasTypeAnnotationMethodInfo);
    }

    /// <summary>
    ///     Generates code for <see cref="IKey" /> objects.
    /// </summary>
    /// <param name="entityTypeBuilderName">The name of the builder variable.</param>
    /// <param name="keys">The keys.</param>
    /// <param name="primaryKey">The primary key.</param>
    /// <param name="stringBuilder">The builder code is added to.</param>
    protected virtual void GenerateKeys(