using System.Text.Json;

namespace DataSharing.LuZhou.LuZhou110
{
    public class JsonPascalNamingPolicy : JsonNamingPolicy
    {
        /// <summary>When overridden in a derived class, converts the specified name according to the policy.</summary>
        /// <param name="name">The name to convert.</param>
        /// <returns>The converted name.</returns>
        public override string ConvertName(string name)
        {
            if (string.IsNullOrEmpty(name) || char.IsUpper(name[0]))
                return name;
            var chars = name.ToCharArray();
            chars[0] = char.ToUpperInvariant(chars.First());
            return new string(chars);
        }
    }
}
