// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618

namespace System.Runtime.CompilerServices
{
    using System;
    using System.CodeDom.Compiler;

    [GeneratedCode("Microsoft.Extensions.Configuration.Binder.SourceGeneration", "42.42.42.42")]
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    file sealed class InterceptsLocationAttribute : Attribute
    {
        public InterceptsLocationAttribute(int version, string data)
        {
        }
    }
}

namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
{
    using Microsoft.Extensions.Configuration;
    using System;
    using System.CodeDom.Compiler;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Runtime.CompilerServices;

    [GeneratedCode("Microsoft.Extensions.Configuration.Binder.SourceGeneration", "42.42.42.42")]
    file static class BindingExtensions
    {
        #region IConfiguration extensions.
        /// <summary>Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively.</summary>
        [InterceptsLocation(1, "4gHRpL26b2ISfu2l3hr4fToBAABzcmMtMC5jcw==")] // src-0.cs(13,16)
        public static void Bind_ProgramMyClass(this IConfiguration configuration, object? instance)
        {
            ArgumentNullException.ThrowIfNull(configuration);

            if (instance is null)
            {
                return;
            }

            var typedObj = (global::Program.MyClass)instance;
            BindCore(configuration, ref typedObj, defaultValueIfNotFound: false, binderOptions: null);
        }
        #endregion IConfiguration extensions.

        #region Core binding extensions.
        private readonly static Lazy<HashSet<string>> s_configKeys_ProgramMyClass = new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Prop0", "Prop1", "Prop2", "Prop3", "Prop4", "Prop5", "Prop6", "Prop8", "Prop9", "Prop10", "Prop13", "Prop14", "Prop15", "Prop16", "Prop17", "Prop19", "Prop20", "Prop21", "Prop23", "Prop24", "Prop25", "Prop26", "Prop27", "Prop7", "Prop11", "Prop12", "Prop18", "Prop22", "Prop28", "Prop29", "Prop30" });

        public static void BindCore(IConfiguration configuration, ref global::Program.MyClass instance, bool defaultValueIfNotFound, BinderOptions? binderOptions)
        {
            ValidateConfigurationKeys(typeof(global::Program.MyClass), s_configKeys_ProgramMyClass, configuration, binderOptions);

            if (TryGetConfigurationValue(configuration, key: "Prop0", out string? value0))
            {
                if (!string.IsNullOrEmpty(value0))
                {
                    instance.Prop0 = ParseBool(value0, configuration.GetSection("Prop0").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop0 = instance.Prop0;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop1", out string? value1))
            {
                if (!string.IsNullOrEmpty(value1))
                {
                    instance.Prop1 = ParseByte(value1, configuration.GetSection("Prop1").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop1 = instance.Prop1;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop2", out string? value2))
            {
                if (!string.IsNullOrEmpty(value2))
                {
                    instance.Prop2 = ParseSbyte(value2, configuration.GetSection("Prop2").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop2 = instance.Prop2;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop3", out string? value3))
            {
                if (!string.IsNullOrEmpty(value3))
                {
                    instance.Prop3 = ParseChar(value3, configuration.GetSection("Prop3").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop3 = instance.Prop3;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop4", out string? value4))
            {
                if (!string.IsNullOrEmpty(value4))
                {
                    instance.Prop4 = ParseDouble(value4, configuration.GetSection("Prop4").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop4 = instance.Prop4;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop5", out string? value5))
            {
                instance.Prop5 = value5;
            }
            else if (defaultValueIfNotFound)
            {
                var currentValue = instance.Prop5;
                if (currentValue is not null)
                {
                    instance.Prop5 = currentValue;
                }
            }

            if (TryGetConfigurationValue(configuration, key: "Prop6", out string? value6))
            {
                if (!string.IsNullOrEmpty(value6))
                {
                    instance.Prop6 = ParseInt(value6, configuration.GetSection("Prop6").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop6 = instance.Prop6;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop8", out string? value7))
            {
                if (!string.IsNullOrEmpty(value7))
                {
                    instance.Prop8 = ParseShort(value7, configuration.GetSection("Prop8").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop8 = instance.Prop8;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop9", out string? value8))
            {
                if (!string.IsNullOrEmpty(value8))
                {
                    instance.Prop9 = ParseLong(value8, configuration.GetSection("Prop9").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop9 = instance.Prop9;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop10", out string? value9))
            {
                if (!string.IsNullOrEmpty(value9))
                {
                    instance.Prop10 = ParseFloat(value9, configuration.GetSection("Prop10").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop10 = instance.Prop10;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop13", out string? value10))
            {
                if (!string.IsNullOrEmpty(value10))
                {
                    instance.Prop13 = ParseUshort(value10, configuration.GetSection("Prop13").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop13 = instance.Prop13;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop14", out string? value11))
            {
                if (!string.IsNullOrEmpty(value11))
                {
                    instance.Prop14 = ParseUint(value11, configuration.GetSection("Prop14").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop14 = instance.Prop14;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop15", out string? value12))
            {
                if (!string.IsNullOrEmpty(value12))
                {
                    instance.Prop15 = ParseUlong(value12, configuration.GetSection("Prop15").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop15 = instance.Prop15;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop16", out string? value13))
            {
                instance.Prop16 = value13;
            }
            else if (defaultValueIfNotFound)
            {
                var currentValue = instance.Prop16;
                if (currentValue is not null)
                {
                    instance.Prop16 = currentValue;
                }
            }

            if (TryGetConfigurationValue(configuration, key: "Prop17", out string? value14))
            {
                if (value14 is null)
                {
                    instance.Prop17 = null;
                }
                else
                {
                    if (!string.IsNullOrEmpty(value14))
                    {
                        instance.Prop17 = ParseSystemGlobalizationCultureInfo(value14, configuration.GetSection("Prop17").Path);
                    }
                }
            }
            else if (defaultValueIfNotFound)
            {
                var currentValue = instance.Prop17;
                if (currentValue is not null)
                {
                    instance.Prop17 = currentValue;
                }
            }

            if (TryGetConfigurationValue(configuration, key: "Prop19", out string? value15))
            {
                if (!string.IsNullOrEmpty(value15))
                {
                    instance.Prop19 = ParseSystemDateTime(value15, configuration.GetSection("Prop19").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop19 = instance.Prop19;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop20", out string? value16))
            {
                if (!string.IsNullOrEmpty(value16))
                {
                    instance.Prop20 = ParseSystemDateTimeOffset(value16, configuration.GetSection("Prop20").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop20 = instance.Prop20;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop21", out string? value17))
            {
                if (!string.IsNullOrEmpty(value17))
                {
                    instance.Prop21 = ParseDecimal(value17, configuration.GetSection("Prop21").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop21 = instance.Prop21;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop23", out string? value18))
            {
                if (!string.IsNullOrEmpty(value18))
                {
                    instance.Prop23 = ParseSystemTimeSpan(value18, configuration.GetSection("Prop23").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop23 = instance.Prop23;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop24", out string? value19))
            {
                if (!string.IsNullOrEmpty(value19))
                {
                    instance.Prop24 = ParseSystemGuid(value19, configuration.GetSection("Prop24").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop24 = instance.Prop24;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop25", out string? value20))
            {
                if (value20 is null)
                {
                    instance.Prop25 = null;
                }
                else
                {
                    if (!string.IsNullOrEmpty(value20))
                    {
                        instance.Prop25 = ParseSystemUri(value20, configuration.GetSection("Prop25").Path);
                    }
                }
            }
            else if (defaultValueIfNotFound)
            {
                var currentValue = instance.Prop25;
                if (currentValue is not null)
                {
                    instance.Prop25 = currentValue;
                }
            }

            if (TryGetConfigurationValue(configuration, key: "Prop26", out string? value21))
            {
                if (value21 is null)
                {
                    instance.Prop26 = null;
                }
                else
                {
                    if (!string.IsNullOrEmpty(value21))
                    {
                        instance.Prop26 = ParseSystemVersion(value21, configuration.GetSection("Prop26").Path);
                    }
                }
            }
            else if (defaultValueIfNotFound)
            {
                var currentValue = instance.Prop26;
                if (currentValue is not null)
                {
                    instance.Prop26 = currentValue;
                }
            }

            if (TryGetConfigurationValue(configuration, key: "Prop27", out string? value22))
            {
                if (!string.IsNullOrEmpty(value22))
                {
                    instance.Prop27 = ParseEnum<global::System.DayOfWeek>(value22, configuration.GetSection("Prop27").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop27 = instance.Prop27;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop7", out string? value23))
            {
                if (!string.IsNullOrEmpty(value23))
                {
                    instance.Prop7 = ParseSystemInt128(value23, configuration.GetSection("Prop7").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop7 = instance.Prop7;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop11", out string? value24))
            {
                if (!string.IsNullOrEmpty(value24))
                {
                    instance.Prop11 = ParseSystemHalf(value24, configuration.GetSection("Prop11").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop11 = instance.Prop11;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop12", out string? value25))
            {
                if (!string.IsNullOrEmpty(value25))
                {
                    instance.Prop12 = ParseSystemUInt128(value25, configuration.GetSection("Prop12").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop12 = instance.Prop12;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop18", out string? value26))
            {
                if (!string.IsNullOrEmpty(value26))
                {
                    instance.Prop18 = ParseSystemDateOnly(value26, configuration.GetSection("Prop18").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop18 = instance.Prop18;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop22", out string? value27))
            {
                if (!string.IsNullOrEmpty(value27))
                {
                    instance.Prop22 = ParseSystemTimeOnly(value27, configuration.GetSection("Prop22").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop22 = instance.Prop22;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop28", out string? value28))
            {
                if (value28 is null)
                {
                    instance.Prop28 = null;
                }
                else
                {
                    if (value28 == string.Empty)
                    {
                        instance.Prop28 = ParseByteArray(value28, configuration.GetSection("Prop28").Path);
                    }
                    else if (!string.IsNullOrEmpty(value28))
                    {
                        instance.Prop28 = ParseByteArray(value28, configuration.GetSection("Prop28").Path);
                    }
                }
            }
            else if (defaultValueIfNotFound)
            {
                var currentValue = instance.Prop28;
                if (currentValue is not null)
                {
                    instance.Prop28 = currentValue;
                }
            }

            if (TryGetConfigurationValue(configuration, key: "Prop29", out string? value29))
            {
                if (!string.IsNullOrEmpty(value29))
                {
                    instance.Prop29 = ParseInt(value29, configuration.GetSection("Prop29").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop29 = instance.Prop29;
            }

            if (TryGetConfigurationValue(configuration, key: "Prop30", out string? value30))
            {
                if (!string.IsNullOrEmpty(value30))
                {
                    instance.Prop30 = ParseSystemDateTime(value30, configuration.GetSection("Prop30").Path);
                }
            }
            else if (defaultValueIfNotFound)
            {
                instance.Prop30 = instance.Prop30;
            }
        }

        /// <summary>Tries to get the configuration value for the specified key.</summary>
        public static bool TryGetConfigurationValue(IConfiguration configuration, string key, out string? value)
        {
            if (configuration is ConfigurationSection section)
            {
                return section.TryGetValue(key, out value);
            }
        
            value = key != null ? configuration[key] : configuration is IConfigurationSection sec ? sec.Value : null;
            return value != null;
        }


        /// <summary>If required by the binder options, validates that there are no unknown keys in the input configuration object.</summary>
        public static void ValidateConfigurationKeys(Type type, Lazy<HashSet<string>> keys, IConfiguration configuration, BinderOptions? binderOptions)
        {
            if (binderOptions?.ErrorOnUnknownConfiguration is true)
            {
                List<string>? temp = null;
        
                foreach (IConfigurationSection section in configuration.GetChildren())
                {
                    if (!keys.Value.Contains(section.Key))
                    {
                        (temp ??= new List<string>()).Add($"'{section.Key}'");
                    }
                }
        
                if (temp is not null)
                {
                    throw new InvalidOperationException($"'ErrorOnUnknownConfiguration' was set on the provided BinderOptions, but the following properties were not found on the instance of {type}: {string.Join(", ", temp)}");
                }
            }
        }

        public static T ParseEnum<T>(string value, string? path) where T : struct
        {
            try
            {
                return Enum.Parse<T>(value, ignoreCase: true);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(T)}'.", exception);
            }
        }

        public static bool ParseBool(string value, string? path)
        {
            try
            {
                return bool.Parse(value);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(bool)}'.", exception);
            }
        }

        public static byte ParseByte(string value, string? path)
        {
            try
            {
                return byte.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(byte)}'.", exception);
            }
        }

        public static sbyte ParseSbyte(string value, string? path)
        {
            try
            {
                return sbyte.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(sbyte)}'.", exception);
            }
        }

        public static char ParseChar(string value, string? path)
        {
            try
            {
                return char.Parse(value);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(char)}'.", exception);
            }
        }

        public static double ParseDouble(string value, string? path)
        {
            try
            {
                return double.Parse(value, NumberStyles.Float, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(double)}'.", exception);
            }
        }

        public static int ParseInt(string value, string? path)
        {
            try
            {
                return int.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(int)}'.", exception);
            }
        }

        public static short ParseShort(string value, string? path)
        {
            try
            {
                return short.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(short)}'.", exception);
            }
        }

        public static long ParseLong(string value, string? path)
        {
            try
            {
                return long.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(long)}'.", exception);
            }
        }

        public static float ParseFloat(string value, string? path)
        {
            try
            {
                return float.Parse(value, NumberStyles.Float, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(float)}'.", exception);
            }
        }

        public static ushort ParseUshort(string value, string? path)
        {
            try
            {
                return ushort.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(ushort)}'.", exception);
            }
        }

        public static uint ParseUint(string value, string? path)
        {
            try
            {
                return uint.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(uint)}'.", exception);
            }
        }

        public static ulong ParseUlong(string value, string? path)
        {
            try
            {
                return ulong.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(ulong)}'.", exception);
            }
        }

        public static global::System.Globalization.CultureInfo ParseSystemGlobalizationCultureInfo(string value, string? path)
        {
            try
            {
                return CultureInfo.GetCultureInfo(value);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.Globalization.CultureInfo)}'.", exception);
            }
        }

        public static global::System.DateTime ParseSystemDateTime(string value, string? path)
        {
            try
            {
                return global::System.DateTime.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.DateTime)}'.", exception);
            }
        }

        public static global::System.DateTimeOffset ParseSystemDateTimeOffset(string value, string? path)
        {
            try
            {
                return global::System.DateTimeOffset.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.DateTimeOffset)}'.", exception);
            }
        }

        public static decimal ParseDecimal(string value, string? path)
        {
            try
            {
                return decimal.Parse(value, NumberStyles.Float, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(decimal)}'.", exception);
            }
        }

        public static global::System.TimeSpan ParseSystemTimeSpan(string value, string? path)
        {
            try
            {
                return global::System.TimeSpan.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.TimeSpan)}'.", exception);
            }
        }

        public static global::System.Guid ParseSystemGuid(string value, string? path)
        {
            try
            {
                return global::System.Guid.Parse(value);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.Guid)}'.", exception);
            }
        }

        public static global::System.Uri ParseSystemUri(string value, string? path)
        {
            try
            {
                return new Uri(value, UriKind.RelativeOrAbsolute);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.Uri)}'.", exception);
            }
        }

        public static global::System.Version ParseSystemVersion(string value, string? path)
        {
            try
            {
                return global::System.Version.Parse(value);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.Version)}'.", exception);
            }
        }

        public static global::System.Int128 ParseSystemInt128(string value, string? path)
        {
            try
            {
                return global::System.Int128.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.Int128)}'.", exception);
            }
        }

        public static global::System.Half ParseSystemHalf(string value, string? path)
        {
            try
            {
                return global::System.Half.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.Half)}'.", exception);
            }
        }

        public static global::System.UInt128 ParseSystemUInt128(string value, string? path)
        {
            try
            {
                return global::System.UInt128.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.UInt128)}'.", exception);
            }
        }

        public static global::System.DateOnly ParseSystemDateOnly(string value, string? path)
        {
            try
            {
                return global::System.DateOnly.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.DateOnly)}'.", exception);
            }
        }

        public static global::System.TimeOnly ParseSystemTimeOnly(string value, string? path)
        {
            try
            {
                return global::System.TimeOnly.Parse(value, CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.TimeOnly)}'.", exception);
            }
        }

        public static byte[] ParseByteArray(string value, string? path)
        {
            try
            {
                return Convert.FromBase64String(value);
            }
            catch (Exception exception)
            {
                throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(byte[])}'.", exception);
            }
        }
        #endregion Core binding extensions.
    }
}
