namespace DatabaseUpdater
{
    using Insite.Core.Interfaces.Providers;
    using Insite.Core.Providers;

    public class DbUpdaterPrivateConnectionStringProvider(
        string connectionString,
        string extensionsConnectionString
    ) : IPrivateConnectionStringProvider, IConnectionStringProvider
    {
        public string ConnectionString { get; } = connectionString;

        public string AdminConnectionString => this.ConnectionString;

        public string ExtensionsConnectionString { get; } = extensionsConnectionString;

#if !NET6_0_OR_GREATER
        public string ConnectionStringName { get; } =
            ConnectionStringProvider.Current.ConnectionStringName;

#pragma warning disable CS0618 // Type or member is obsolete
        public string ExtensionsConnectionStringName { get; } =
            ConnectionStringProvider.Current.ExtensionsConnectionStringName;
#pragma warning restore CS0618 // Type or member is obsolete
#endif
    }
}
