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

Code before:
    ///     Gets the <see cref="ConfigurationSource" /> for the container column type.
    /// </summary>
    /// <param name="typeBase">The type to get the container column type configuration source for.</param>
    /// <returns>The <see cref="ConfigurationSource" /> for the container column type.</returns>
    public static ConfigurationSource? GetContainerColumnTypeConfigurationSource(this IConventionTypeBase typeBase)
        => typeBase.FindAnnotation(RelationalAnnotationNames.ContainerColumnType)
            ?.GetConfigurationSource();

    /// <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="typeBase">The type.</param>
    /// <returns>
    ///     The value for the JSON property used to store this type.
    ///     <see langword="null" /> is returned for entities that are not mapped to a JSON column.
    /// </returns>
    public static string? GetJsonPropertyName(this IReadOnlyTypeBase typeBase)
    {
        var annotation = typeBase.FindAnnotation(RelationalAnnotationNames.JsonPropertyName);
        if (annotation?.Value is string jsonPropertyName)
        {
            return jsonPropertyName;
        }

        if (typeBase.FindAnnotation(RelationalAnnotationNames.ContainerColumnName) != null)
        {
            return null;
        }

        return !typeBase.IsMappedToJson()
            ? null
            : typeBase is IReadOnlyEntityType entityType
                ? entityType.FindOwnership()!.GetNavigation(pointsToPrincipal: false)!.Name
                : ((IReadOnlyComplexType)typeBase).ComplexProperty.Name;
    }

    /// <summary>
    ///     Sets the value of JSON property name used for the given type mapped to a JSON column.
    /// </summary>
    /// <param name="typeBase">The type.</param>
    /// <param name="name">The name to be used.</param>
    public static void SetJsonPropertyName(this IMutableTypeBase typeBase, string? name)
        => typeBase.SetOrRemoveAnnotation(
            RelationalAnnotationNames.JsonPropertyName,
            Check.NullButNotEmpty(name));

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

Review comment (suggestion):
@copilot 
```suggestion
        if (annotation != null)
        {
            return (string?)annotation.Value;
        }
```

Code after:
    ///     Gets the <see cref="ConfigurationSource" /> for the container column type.
    /// </summary>
    /// <param name="typeBase">The type to get the container column type configuration source for.</param>
    /// <returns>The <see cref="ConfigurationSource" /> for the container column type.</returns>
    public static ConfigurationSource? GetContainerColumnTypeConfigurationSource(this IConventionTypeBase typeBase)
        => typeBase.FindAnnotation(RelationalAnnotationNames.ContainerColumnType)
            ?.GetConfigurationSource();

    /// <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="typeBase">The type.</param>
    /// <returns>
    ///     The value for the JSON property used to store this type.
    ///     <see langword="null" /> is returned for entities that are not mapped to a JSON column.
    /// </returns>
    public static string? GetJsonPropertyName(this IReadOnlyTypeBase typeBase)
    {
        var annotation = typeBase.FindAnnotation(RelationalAnnotationNames.JsonPropertyName);
        if (annotation != null)
        {
            return (string?)annotation.Value;
        }

        return typeBase.FindAnnotation(RelationalAnnotationNames.ContainerColumnName) != null || !typeBase.IsMappedToJson()
            ? null
            : typeBase is IReadOnlyEntityType entityType
                ? entityType.FindOwnership()!.GetNavigation(pointsToPrincipal: false)!.Name
                : ((IReadOnlyComplexType)typeBase).ComplexProperty.Name;
    }

    /// <summary>
    ///     Sets the value of JSON property name used for the given type mapped to a JSON column.
    /// </summary>
    /// <param name="typeBase">The type.</param>
    /// <param name="name">The name to be used.</param>
    public static void SetJsonPropertyName(this IMutableTypeBase typeBase, string? name)
        => typeBase.SetOrRemoveAnnotation(
            RelationalAnnotationNames.JsonPropertyName,
            Check.NullButNotEmpty(name));

    /// <summary>
    ///     Sets the value of JSON property name used for the given type mapped to a JSON column.
    /// </summary>
    /// <param name="typeBase">The 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>