Repository: dotnet/efcore
File: src/EFCore.Relational/Extensions/RelationalEntityTypeExtensions.cs (C#)

Code before:
        => entityType.FindAnnotation(RelationalAnnotationNames.ContainerColumnTypeMapping)
            ?.GetConfigurationSource();

    /// <summary>
    ///     Gets the container column type mapping to which the entity type is mapped.
    /// </summary>
    /// <param name="entityType">The entity type to get the container column type mapping for.</param>
    /// <returns>The container column type mapping to which the entity type is mapped.</returns>
    [Obsolete("Container column mappings are now obtained from IColumnBase.StoreTypeMapping")]
    public static RelationalTypeMapping? GetContainerColumnTypeMapping(this IReadOnlyEntityType entityType)
        => entityType.FindAnnotation(RelationalAnnotationNames.ContainerColumnTypeMapping)?.Value is RelationalTypeMapping typeMapping
            ? typeMapping
            : (entityType.FindOwnership()?.PrincipalEntityType.GetContainerColumnTypeMapping());

    /// <summary>
    ///     Sets the value of JSON property name used for the given entity mapped to a JSON column.
    /// </summary>
    /// <param name="entityType">The entity type.</param>
    /// <param name="name">The name to be used.</param>
    /// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
    /// <returns>The configured value.</returns>
    public static string? SetJsonPropertyName(
        this IConventionEntityType entityType,
        string? name,
        bool fromDataAnnotation = false)
        => entityType.SetJsonPropertyName(name, fromDataAnnotation);

    /// <summary>
    ///     Gets the value of JSON property name used for the given entity mapped to a JSON column.
    /// </summary>
    /// <remarks>
    ///     Unless configured explicitly, navigation name is used.
    /// </remarks>
    /// <param name="entityType">The entity type.</param>
    /// <returns>
    ///     The value for the JSON property used to store this entity type.
    ///     <see langword="null" /> is returned for entities that are not mapped to a JSON column.
    /// </returns>
    public static string? GetJsonPropertyName(this IReadOnlyEntityType entityType)
    {
        var propertyName = entityType.FindAnnotation(RelationalAnnotationNames.JsonPropertyName);
        return propertyName == null
            ? (entityType.IsMappedToJson()
                ? entityType.FindOwnership()!.GetNavigation(pointsToPrincipal: false)!.Name
                : null)
            : (string?)propertyName.Value;
    }

    /// <summary>
    ///     Sets the value of JSON property name used for the given entity mapped to a JSON column.
    /// </summary>

Review comment (suggestion):
@copilot You need to upcast these 3 calls to avoid infinite recursion

Code after:
        => entityType.FindAnnotation(RelationalAnnotationNames.ContainerColumnTypeMapping)
            ?.GetConfigurationSource();

    /// <summary>
    ///     Gets the container column type mapping to which the entity type is mapped.
    /// </summary>
    /// <param name="entityType">The entity type to get the container column type mapping for.</param>
    /// <returns>The container column type mapping to which the entity type is mapped.</returns>
    [Obsolete("Container column mappings are now obtained from IColumnBase.StoreTypeMapping")]
    public static RelationalTypeMapping? GetContainerColumnTypeMapping(this IReadOnlyEntityType entityType)
        => entityType.FindAnnotation(RelationalAnnotationNames.ContainerColumnTypeMapping)?.Value is RelationalTypeMapping typeMapping
            ? typeMapping
            : (entityType.FindOwnership()?.PrincipalEntityType.GetContainerColumnTypeMapping());

    /// <summary>
    ///     Sets the value of JSON property name used for the given entity mapped to a JSON column.
    /// </summary>
    /// <param name="entityType">The entity type.</param>
    /// <param name="name">The name to be used.</param>
    /// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
    /// <returns>The configured value.</returns>
    public static string? SetJsonPropertyName(
        this IConventionEntityType entityType,
        string? name,
        bool fromDataAnnotation = false)
        => ((IConventionTypeBase)entityType).SetJsonPropertyName(name, fromDataAnnotation);

    /// <summary>
    ///     Gets the value of JSON property name used for the given entity mapped to a JSON column.
    /// </summary>
    /// <remarks>
    ///     Unless configured explicitly, navigation name is used.
    /// </remarks>
    /// <param name="entityType">The entity type.</param>
    /// <returns>
    ///     The value for the JSON property used to store this entity type.
    ///     <see langword="null" /> is returned for entities that are not mapped to a JSON column.
    /// </returns>
    public static string? GetJsonPropertyName(this IReadOnlyEntityType entityType)
    {
        var propertyName = entityType.FindAnnotation(RelationalAnnotationNames.JsonPropertyName);
        return propertyName == null
            ? (entityType.IsMappedToJson()
                ? entityType.FindOwnership()!.GetNavigation(pointsToPrincipal: false)!.Name
                : null)
            : (string?)propertyName.Value;
    }

    /// <summary>
    ///     Sets the value of JSON property name used for the given entity mapped to a JSON column.
    /// </summary>