diff --git a/Directory.Build.props b/Directory.Build.props index 3c8ea6ba..2765df4b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 AnyCPU enable enable diff --git a/DubUrl.Adomd/Mapping/PowerBiDesktopMapper.cs b/DubUrl.Adomd/Mapping/PowerBiDesktopMapper.cs index ab7e1c25..e7b28770 100644 --- a/DubUrl.Adomd/Mapping/PowerBiDesktopMapper.cs +++ b/DubUrl.Adomd/Mapping/PowerBiDesktopMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Adomd.Mapping; [Mapper( "Microsoft.AnalysisServices.AdomdClient" )] -internal class PowerBiDesktopMapper : PowerBiPremiumMapper +public class PowerBiDesktopMapper : PowerBiPremiumMapper { public PowerBiDesktopMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new PowerBiDesktopRewriter(csb), @@ -22,4 +22,4 @@ public PowerBiDesktopMapper(DbConnectionStringBuilder csb, IDialect dialect, IPa parametrizer ) { } -} \ No newline at end of file +} diff --git a/DubUrl.Adomd/Mapping/PowerBiPremiumMapper.cs b/DubUrl.Adomd/Mapping/PowerBiPremiumMapper.cs index cacf70b2..0b483361 100644 --- a/DubUrl.Adomd/Mapping/PowerBiPremiumMapper.cs +++ b/DubUrl.Adomd/Mapping/PowerBiPremiumMapper.cs @@ -15,7 +15,7 @@ namespace DubUrl.Adomd.Mapping; [Mapper( "Microsoft.AnalysisServices.AdomdClient" )] -internal class PowerBiPremiumMapper : BaseMapper +public class PowerBiPremiumMapper : BaseMapper { public PowerBiPremiumMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : this(new PowerBiPremiumRewriter(csb), @@ -30,4 +30,4 @@ protected PowerBiPremiumMapper(ConnectionStringRewriter rewriter, IDialect diale parametrizer ) { } -} \ No newline at end of file +} diff --git a/DubUrl.Core/Locating/OdbcDriver/BaseDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/BaseDriverLocator.cs index 902baa14..d3f8f9e5 100644 --- a/DubUrl.Core/Locating/OdbcDriver/BaseDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/BaseDriverLocator.cs @@ -7,7 +7,7 @@ namespace DubUrl.Locating.OdbcDriver; -internal abstract class BaseDriverLocator : IDriverLocator +public abstract class BaseDriverLocator : IDriverLocator { protected string RegexPattern { get; } protected DriverLister Lister { get; } diff --git a/DubUrl.Core/Locating/OdbcDriver/DriverLister.cs b/DubUrl.Core/Locating/OdbcDriver/DriverLister.cs index 4bbd1c16..d4772341 100644 --- a/DubUrl.Core/Locating/OdbcDriver/DriverLister.cs +++ b/DubUrl.Core/Locating/OdbcDriver/DriverLister.cs @@ -8,7 +8,7 @@ namespace DubUrl.Locating.OdbcDriver; -internal class DriverLister +public class DriverLister { public virtual string[] List() { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/DrillDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/DrillDriverLocator.cs index d4998651..d75f8908 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/DrillDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/DrillDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class DrillDriverLocator : BaseDriverLocator +public class DrillDriverLocator : BaseDriverLocator { internal class DrillDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/DuckdbDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/DuckdbDriverLocator.cs index 13fcd58d..20b59546 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/DuckdbDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/DuckdbDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class DuckdbDriverLocator : BaseDriverLocator +public class DuckdbDriverLocator : BaseDriverLocator { internal class DuckdbDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/MariaDbDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/MariaDbDriverLocator.cs index 81864c49..2de7db21 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/MariaDbDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/MariaDbDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class MariaDbDriverLocator : BaseDriverLocator +public class MariaDbDriverLocator : BaseDriverLocator { internal class MariaDbDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/MsExcelDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/MsExcelDriverLocator.cs index dd540509..31f6ab91 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/MsExcelDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/MsExcelDriverLocator.cs @@ -11,7 +11,7 @@ namespace DubUrl.Locating.OdbcDriver; [Driver()] -internal class MsExcelDriverLocator : BaseDriverLocator +public class MsExcelDriverLocator : BaseDriverLocator { internal class MsExcelDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/MssqlDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/MssqlDriverLocator.cs index 5dd56051..f4cd755c 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/MssqlDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/MssqlDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class MssqlDriverLocator : BaseDriverLocator +public class MssqlDriverLocator : BaseDriverLocator { internal class MssqlDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/MySqlConnectorDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/MySqlConnectorDriverLocator.cs index a701a257..8946d943 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/MySqlConnectorDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/MySqlConnectorDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class MySqlConnectorDriverLocator : BaseDriverLocator +public class MySqlConnectorDriverLocator : BaseDriverLocator { internal class MySqlConnectorDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/PostgresqlDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/PostgresqlDriverLocator.cs index 41293e3d..796895d0 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/PostgresqlDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/PostgresqlDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class PostgresqlDriverLocator : BaseDriverLocator +public class PostgresqlDriverLocator : BaseDriverLocator { internal class PostgresqlDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/QuestDbDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/QuestDbDriverLocator.cs index 9e23ba68..3390c2d6 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/QuestDbDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/QuestDbDriverLocator.cs @@ -11,7 +11,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class QuestDbDriverLocator : PostgresqlDriverLocator +public class QuestDbDriverLocator : PostgresqlDriverLocator { public QuestDbDriverLocator() : this(EncodingOption.Unspecified, ArchitectureOption.Unspecified) { } diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/TextDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/TextDriverLocator.cs index 15497075..6b1f77b5 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/TextDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/TextDriverLocator.cs @@ -11,7 +11,7 @@ namespace DubUrl.Locating.OdbcDriver; [Driver()] -internal class TextDriverLocator : BaseDriverLocator +public class TextDriverLocator : BaseDriverLocator { internal class TextDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/TimescaleDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/TimescaleDriverLocator.cs index 75c1e179..510562ac 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/TimescaleDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/TimescaleDriverLocator.cs @@ -11,7 +11,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class TimescaleDriverLocator : PostgresqlDriverLocator +public class TimescaleDriverLocator : PostgresqlDriverLocator { public TimescaleDriverLocator() : this(EncodingOption.Unspecified, ArchitectureOption.Unspecified) { } diff --git a/DubUrl.Core/Locating/OdbcDriver/Implementation/TrinoDriverLocator.cs b/DubUrl.Core/Locating/OdbcDriver/Implementation/TrinoDriverLocator.cs index 4c889d99..070e64ce 100644 --- a/DubUrl.Core/Locating/OdbcDriver/Implementation/TrinoDriverLocator.cs +++ b/DubUrl.Core/Locating/OdbcDriver/Implementation/TrinoDriverLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.Locating.OdbcDriver.Implementation; [Driver()] -internal class TrinoDriverLocator : BaseDriverLocator +public class TrinoDriverLocator : BaseDriverLocator { internal class TrinoDriverRegex : BaseDriverRegex { diff --git a/DubUrl.Core/Locating/Options/LocatorOptionAttribute.cs b/DubUrl.Core/Locating/Options/LocatorOptionAttribute.cs index 6f1e3fe4..4ca58d0d 100644 --- a/DubUrl.Core/Locating/Options/LocatorOptionAttribute.cs +++ b/DubUrl.Core/Locating/Options/LocatorOptionAttribute.cs @@ -7,7 +7,7 @@ namespace DubUrl.Locating.Options; [AttributeUsage(AttributeTargets.Enum, Inherited = true, AllowMultiple = false)] -sealed class LocatorOptionAttribute : Attribute +public sealed class LocatorOptionAttribute : Attribute { public LocatorOptionAttribute() { } diff --git a/DubUrl.Core/Mapping/BaseMapperIntrospector.cs b/DubUrl.Core/Mapping/BaseMapperIntrospector.cs index 551edb5e..36c13347 100644 --- a/DubUrl.Core/Mapping/BaseMapperIntrospector.cs +++ b/DubUrl.Core/Mapping/BaseMapperIntrospector.cs @@ -17,10 +17,11 @@ protected record class AttributeInfo(Type Type, T Attribute) { } protected Type[] Types { get => _types ??= Probe.Locate().ToArray(); } protected BaseIntrospector(ITypesProbe probe) - => (Probe) = (probe); + => (Probe) = (probe); protected IEnumerable> LocateAttribute() where T : Attribute - => Types.Where( + { + var types = Types.Where( x => x.GetCustomAttributes(typeof(T), false).Length > 0 ) .Select(x => (Type: x, Attribute: x.GetCustomAttribute() ?? throw new InvalidOperationException())) @@ -29,6 +30,8 @@ protected IEnumerable> LocateAttribute() where T : Attribute x.Type, x.Attribute )); + return types; + } } public class AssemblyTypesProbe : ITypesProbe @@ -44,7 +47,12 @@ public AssemblyTypesProbe(Assembly[] assemblies) public virtual IEnumerable Locate() => Assemblies.Aggregate( Array.Empty(), (types, asm) - => types.Concat(asm.GetTypes().Where(x => x.IsClass && !x.IsAbstract)).ToArray() +//#if NET7_0_OR_GREATER + => types.Concat(asm.GetExportedTypes().Where(x => x.IsClass && !x.IsAbstract)).ToArray() +//#else +// => types.Concat(asm.GetTypes().Where(x => x.IsClass && !x.IsAbstract)).ToArray() +//#endif + ); } diff --git a/DubUrl.Core/Mapping/Implementation/CockRoachMapper.cs b/DubUrl.Core/Mapping/Implementation/CockRoachMapper.cs index 04289846..d681d17d 100644 --- a/DubUrl.Core/Mapping/Implementation/CockRoachMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/CockRoachMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper("Npgsql")] -internal class CockRoachMapper : PostgresqlMapper +public class CockRoachMapper : PostgresqlMapper { public CockRoachMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new CockRoachRewriter(csb), dialect, parametrizer) { } diff --git a/DubUrl.Core/Mapping/Implementation/Db2Mapper.cs b/DubUrl.Core/Mapping/Implementation/Db2Mapper.cs index 5b311218..fbca380b 100644 --- a/DubUrl.Core/Mapping/Implementation/Db2Mapper.cs +++ b/DubUrl.Core/Mapping/Implementation/Db2Mapper.cs @@ -13,7 +13,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper("IBM.Data.Db2")] -internal class Db2Mapper : BaseMapper +public class Db2Mapper : BaseMapper { public Db2Mapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new Db2Rewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/DuckdbMapper.cs b/DubUrl.Core/Mapping/Implementation/DuckdbMapper.cs index 11bc2bb6..603b81be 100644 --- a/DubUrl.Core/Mapping/Implementation/DuckdbMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/DuckdbMapper.cs @@ -15,7 +15,7 @@ namespace DubUrl.Mapping.Implementation; [MapperAttribute( "DuckDB.NET.Data" )] -internal class DuckdbMapper : BaseMapper +public class DuckdbMapper : BaseMapper { public DuckdbMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new DuckdbRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/FirebirdSqlMapper.cs b/DubUrl.Core/Mapping/Implementation/FirebirdSqlMapper.cs index b7bace2b..fe4447af 100644 --- a/DubUrl.Core/Mapping/Implementation/FirebirdSqlMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/FirebirdSqlMapper.cs @@ -12,7 +12,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper("FirebirdSql.Data.FirebirdClient")] -internal class FirebirdSqlMapper : BaseMapper +public class FirebirdSqlMapper : BaseMapper { public FirebirdSqlMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new FirebirdSqlRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/MariaDbConnectorMapper.cs b/DubUrl.Core/Mapping/Implementation/MariaDbConnectorMapper.cs index c77e5612..3a86733b 100644 --- a/DubUrl.Core/Mapping/Implementation/MariaDbConnectorMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/MariaDbConnectorMapper.cs @@ -12,7 +12,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper("MySqlConnector")] -internal class MariaDbConnectorMapper : MySqlConnectorMapper +public class MariaDbConnectorMapper : MySqlConnectorMapper { public MariaDbConnectorMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(csb, dialect, parametrizer) diff --git a/DubUrl.Core/Mapping/Implementation/MariaDbDataMapper.cs b/DubUrl.Core/Mapping/Implementation/MariaDbDataMapper.cs index 4351f380..ff50ace7 100644 --- a/DubUrl.Core/Mapping/Implementation/MariaDbDataMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/MariaDbDataMapper.cs @@ -12,7 +12,7 @@ namespace DubUrl.Mapping.Implementation; [AlternativeMapper("MySql.Data")] -internal class MariaDbDataRewriter : MySqlDataMapper +public class MariaDbDataRewriter : MySqlDataMapper { public MariaDbDataRewriter(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(csb, dialect, parametrizer) diff --git a/DubUrl.Core/Mapping/Implementation/MsSqlServerMapper.cs b/DubUrl.Core/Mapping/Implementation/MsSqlServerMapper.cs index bcd1f3d1..80151776 100644 --- a/DubUrl.Core/Mapping/Implementation/MsSqlServerMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/MsSqlServerMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Microsoft.Data.SqlClient" )] -internal class MsSqlServerMapper : BaseMapper +public class MsSqlServerMapper : BaseMapper { public MsSqlServerMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new MsSqlServerRewriter(csb), @@ -22,4 +22,4 @@ public MsSqlServerMapper(DbConnectionStringBuilder csb, IDialect dialect, IParam parametrizer ) { } -} \ No newline at end of file +} diff --git a/DubUrl.Core/Mapping/Implementation/MySqlConnectorMapper.cs b/DubUrl.Core/Mapping/Implementation/MySqlConnectorMapper.cs index 25055d6a..802fc4e4 100644 --- a/DubUrl.Core/Mapping/Implementation/MySqlConnectorMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/MySqlConnectorMapper.cs @@ -16,7 +16,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "MySqlConnector" )] -internal class MySqlConnectorMapper : BaseMapper +public class MySqlConnectorMapper : BaseMapper { public MySqlConnectorMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new MySqlConnectorRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/MySqlDataMapper.cs b/DubUrl.Core/Mapping/Implementation/MySqlDataMapper.cs index c35064e2..a08760b5 100644 --- a/DubUrl.Core/Mapping/Implementation/MySqlDataMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/MySqlDataMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [AlternativeMapper( "MySql.Data" )] -internal class MySqlDataMapper : MySqlConnectorMapper +public class MySqlDataMapper : MySqlConnectorMapper { public MySqlDataMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new MySqlDataRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/OdbcDbqMapper.cs b/DubUrl.Core/Mapping/Implementation/OdbcDbqMapper.cs index 39ebfb1f..69ee6d1e 100644 --- a/DubUrl.Core/Mapping/Implementation/OdbcDbqMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/OdbcDbqMapper.cs @@ -16,7 +16,7 @@ namespace DubUrl.Mapping.Implementation; [WrapperMapper( "System.Data.Odbc" )] -internal class OdbcDbqMapper : BaseMapper, IOdbcMapper +public class OdbcDbqMapper : BaseMapper, IOdbcMapper { public OdbcDbqMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new OdbcDbqRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/OdbcMapper.cs b/DubUrl.Core/Mapping/Implementation/OdbcMapper.cs index af310d0f..08f0bbff 100644 --- a/DubUrl.Core/Mapping/Implementation/OdbcMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/OdbcMapper.cs @@ -30,5 +30,4 @@ public OdbcMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer ) { } - } diff --git a/DubUrl.Core/Mapping/Implementation/OracleManagedDataAccessMapper.cs b/DubUrl.Core/Mapping/Implementation/OracleManagedDataAccessMapper.cs index 97c8b762..590edb48 100644 --- a/DubUrl.Core/Mapping/Implementation/OracleManagedDataAccessMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/OracleManagedDataAccessMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Oracle.ManagedDataAccess" )] -internal class OracleManagedDataAccessMapper : BaseMapper +public class OracleManagedDataAccessMapper : BaseMapper { public OracleManagedDataAccessMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new OracleManagedDataAccessRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/PostgresqlMapper.cs b/DubUrl.Core/Mapping/Implementation/PostgresqlMapper.cs index 314f5b5e..2641d960 100644 --- a/DubUrl.Core/Mapping/Implementation/PostgresqlMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/PostgresqlMapper.cs @@ -15,7 +15,7 @@ namespace DubUrl.Mapping.Implementation; [MapperAttribute( "Npgsql" )] -internal class PostgresqlMapper : BaseMapper +public class PostgresqlMapper : BaseMapper { public PostgresqlMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new PostgresqlRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/QuestDbMapper.cs b/DubUrl.Core/Mapping/Implementation/QuestDbMapper.cs index 35adb67e..9820c62a 100644 --- a/DubUrl.Core/Mapping/Implementation/QuestDbMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/QuestDbMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Npgsql" )] -internal class QuestDbMapper : PostgresqlMapper +public class QuestDbMapper : PostgresqlMapper { public QuestDbMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new QuestDbRewriter(csb), dialect, parametrizer) diff --git a/DubUrl.Core/Mapping/Implementation/SnowflakeMapper.cs b/DubUrl.Core/Mapping/Implementation/SnowflakeMapper.cs index acbe2cd6..9a9d114a 100644 --- a/DubUrl.Core/Mapping/Implementation/SnowflakeMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/SnowflakeMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Snowflake.Data" )] -internal class SnowflakeMapper : BaseMapper +public class SnowflakeMapper : BaseMapper { public SnowflakeMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new SnowflakeRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/SqliteMapper.cs b/DubUrl.Core/Mapping/Implementation/SqliteMapper.cs index 20a11779..822f98ff 100644 --- a/DubUrl.Core/Mapping/Implementation/SqliteMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/SqliteMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Microsoft.Data.Sqlite" )] -internal class SqliteMapper : BaseMapper +public class SqliteMapper : BaseMapper { public SqliteMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new SqliteRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/TeradataMapper.cs b/DubUrl.Core/Mapping/Implementation/TeradataMapper.cs index e19d33b2..f8faec62 100644 --- a/DubUrl.Core/Mapping/Implementation/TeradataMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/TeradataMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Teradata.Client" )] -internal class TeradataMapper : BaseMapper +public class TeradataMapper : BaseMapper { public TeradataMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new TeradataRewriter(csb), diff --git a/DubUrl.Core/Mapping/Implementation/TimescaleMapper.cs b/DubUrl.Core/Mapping/Implementation/TimescaleMapper.cs index 1da1608c..30dcadb9 100644 --- a/DubUrl.Core/Mapping/Implementation/TimescaleMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/TimescaleMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "Npgsql" )] -internal class TimescaleMapper : PostgresqlMapper +public class TimescaleMapper : PostgresqlMapper { public TimescaleMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new TimescaleRewriter(csb), dialect, parametrizer) diff --git a/DubUrl.Core/Mapping/Implementation/TrinoMapper.cs b/DubUrl.Core/Mapping/Implementation/TrinoMapper.cs index 2b8eb1e9..33dae681 100644 --- a/DubUrl.Core/Mapping/Implementation/TrinoMapper.cs +++ b/DubUrl.Core/Mapping/Implementation/TrinoMapper.cs @@ -14,7 +14,7 @@ namespace DubUrl.Mapping.Implementation; [Mapper( "NReco.PrestoAdo" )] -internal class TrinoMapper : BaseMapper +public class TrinoMapper : BaseMapper { public TrinoMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrizer parametrizer) : base(new TrinoRewriter(csb), @@ -22,4 +22,4 @@ public TrinoMapper(DbConnectionStringBuilder csb, IDialect dialect, IParametrize parametrizer ) { } -} \ No newline at end of file +} diff --git a/DubUrl.Core/Registering/BinFolderDiscoverer.cs b/DubUrl.Core/Registering/BinFolderDiscoverer.cs index 0080c032..970822c4 100644 --- a/DubUrl.Core/Registering/BinFolderDiscoverer.cs +++ b/DubUrl.Core/Registering/BinFolderDiscoverer.cs @@ -69,7 +69,7 @@ public virtual IEnumerable Execute() ?? AppDomain.CurrentDomain.Load(AssemblyName.GetAssemblyName(asmPath)); //Check if assembly contains a DbProviderFactory - var types = asm.DefinedTypes; + var types = asm.GetExportedTypes(); var providerFactories = types.Where(t => t.IsClass && t.IsVisible diff --git a/DubUrl.Core/Registering/ReferencedAssembliesDiscoverer.cs b/DubUrl.Core/Registering/ReferencedAssembliesDiscoverer.cs index f6046973..a9b261c4 100644 --- a/DubUrl.Core/Registering/ReferencedAssembliesDiscoverer.cs +++ b/DubUrl.Core/Registering/ReferencedAssembliesDiscoverer.cs @@ -43,7 +43,7 @@ public virtual IEnumerable Execute() Debug.WriteLine($"Analyzing assembly {asm.FullName}"); //Check if assembly contains a DbProviderFactory - var types = asm.DefinedTypes; + var types = asm.GetExportedTypes(); var providerFactories = types.Where(t => t.IsClass && t.IsVisible diff --git a/DubUrl.Core/Rewriting/Implementation/OdbcDbqRewriter.cs b/DubUrl.Core/Rewriting/Implementation/OdbcDbqRewriter.cs index e3df75d5..f161d8f8 100644 --- a/DubUrl.Core/Rewriting/Implementation/OdbcDbqRewriter.cs +++ b/DubUrl.Core/Rewriting/Implementation/OdbcDbqRewriter.cs @@ -120,17 +120,21 @@ public override void Execute(UrlInfo urlInfo) } } - protected internal virtual List InitializeOptions() - { - var types = new List(); - AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(assembly => assembly.GetTypes()) - .Where(x => x.IsEnum && x.GetCustomAttributes(typeof(LocatorOptionAttribute), true).Length > 0) - .ToList() - .ForEach(x => types.Add(x)); - return types; + protected internal virtual List InitializeOptions() + { + var types = new List(); + AppDomain.CurrentDomain.GetAssemblies() +#if NET7_0_OR_GREATER + .SelectMany(assembly => assembly.GetExportedTypes()) +#else + .SelectMany(assembly => assembly.GetTypes()) +#endif + .Where(x => x.IsEnum && x.GetCustomAttributes(typeof(LocatorOptionAttribute), true).Length > 0) + .ToList() + .ForEach(x => types.Add(x)); + return types; + } } - } internal class AuthentificationMapper : BaseTokenMapper { diff --git a/DubUrl.Core/Rewriting/Implementation/OdbcRewriter.cs b/DubUrl.Core/Rewriting/Implementation/OdbcRewriter.cs index d2c81580..d926937b 100644 --- a/DubUrl.Core/Rewriting/Implementation/OdbcRewriter.cs +++ b/DubUrl.Core/Rewriting/Implementation/OdbcRewriter.cs @@ -115,17 +115,21 @@ public override void Execute(UrlInfo urlInfo) } } - protected internal virtual List InitializeOptions() - { - var types = new List(); - AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(assembly => assembly.GetTypes()) - .Where(x => x.IsEnum && x.GetCustomAttributes(typeof(LocatorOptionAttribute), true).Length > 0) - .ToList() - .ForEach(x => types.Add(x)); - return types; + protected internal virtual List InitializeOptions() + { + var types = new List(); + AppDomain.CurrentDomain.GetAssemblies() +#if NET7_0_OR_GREATER + .SelectMany(assembly => assembly.GetExportedTypes()) +#else + .SelectMany(assembly => assembly.GetTypes()) +#endif + .Where(x => x.IsEnum && x.GetCustomAttributes(typeof(LocatorOptionAttribute), true).Length > 0) + .ToList() + .ForEach(x => types.Add(x)); + return types; + } } - } protected internal class AuthentificationMapper : BaseTokenMapper { diff --git a/DubUrl.OleDb.Testing/ProviderLocatorIntrospectorTest.cs b/DubUrl.OleDb.Testing/ProviderLocatorIntrospectorTest.cs index 2947eda1..e04a1df2 100644 --- a/DubUrl.OleDb.Testing/ProviderLocatorIntrospectorTest.cs +++ b/DubUrl.OleDb.Testing/ProviderLocatorIntrospectorTest.cs @@ -15,7 +15,7 @@ public void Locate_RealTypes_BrandsAssociated() var introspector = new ProviderLocatorIntrospector(); var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.GreaterThan(0)); + Assert.That(result, Is.Not.Empty); Assert.Multiple(() => { Assert.That(result.Any(x => !string.IsNullOrEmpty(x.Slug)), Is.True); diff --git a/DubUrl.OleDb/BaseProviderLocator.cs b/DubUrl.OleDb/BaseProviderLocator.cs index 6da0edee..1b7a1302 100644 --- a/DubUrl.OleDb/BaseProviderLocator.cs +++ b/DubUrl.OleDb/BaseProviderLocator.cs @@ -10,7 +10,7 @@ namespace DubUrl.OleDb; -internal abstract class BaseProviderLocator : IProviderLocator +public abstract class BaseProviderLocator : IProviderLocator { private string RegexPattern { get; } @@ -24,13 +24,13 @@ public BaseProviderLocator(string regexPattern) public BaseProviderLocator(string regexPattern, BaseTokenMapper[] additionalMappers) : this(regexPattern, new Func(x => x.NickName)) { AdditionalMappers = additionalMappers; } - public BaseProviderLocator(string regexPattern, Func namePointer) + internal BaseProviderLocator(string regexPattern, Func namePointer) : this(regexPattern, namePointer, new ProviderLister()) { } public BaseProviderLocator(string regexPattern, ProviderLister lister) => (RegexPattern, NamePointer, Lister) = (regexPattern, new(x => x.NickName), lister); - public BaseProviderLocator(string regexPattern, Func namePointer, ProviderLister lister) + internal BaseProviderLocator(string regexPattern, Func namePointer, ProviderLister lister) => (RegexPattern, NamePointer, Lister) = (regexPattern, namePointer, lister); public virtual string Locate() diff --git a/DubUrl.OleDb/Mapping/OleDbConnectivity.cs b/DubUrl.OleDb/Mapping/OleDbConnectivity.cs index 8f1b7852..2f8146a8 100644 --- a/DubUrl.OleDb/Mapping/OleDbConnectivity.cs +++ b/DubUrl.OleDb/Mapping/OleDbConnectivity.cs @@ -16,7 +16,7 @@ namespace DubUrl.OleDb.Mapping; "OLE DB" , new[] { "oledb" } )] -internal class OleDbConnectivity : IWrapperConnectivity +public class OleDbConnectivity : IWrapperConnectivity { public string Alias => GetType().GetCustomAttribute()?.Aliases[0] ?? string.Empty; diff --git a/DubUrl.OleDb/ProviderLister.cs b/DubUrl.OleDb/ProviderLister.cs index 36349fc4..024402ed 100644 --- a/DubUrl.OleDb/ProviderLister.cs +++ b/DubUrl.OleDb/ProviderLister.cs @@ -8,7 +8,7 @@ namespace DubUrl.OleDb; -internal class ProviderLister +public class ProviderLister { internal virtual ProviderInfo[] List() { @@ -23,4 +23,4 @@ internal virtual ProviderInfo[] List() } return Array.Empty(); } -} \ No newline at end of file +} diff --git a/DubUrl.OleDb/Providers/AceProviderLocator.cs b/DubUrl.OleDb/Providers/AceProviderLocator.cs index ae91d10c..92470690 100644 --- a/DubUrl.OleDb/Providers/AceProviderLocator.cs +++ b/DubUrl.OleDb/Providers/AceProviderLocator.cs @@ -14,7 +14,7 @@ namespace DubUrl.OleDb.Providers; [Provider] -internal abstract class AceProviderLocator : BaseProviderLocator +public abstract class AceProviderLocator : BaseProviderLocator { internal class AceProviderRegex : BaseProviderRegex { @@ -54,25 +54,25 @@ protected override List RankCandidates() } [ProviderSpecialization("xls")] -internal class AceXlsProviderLocator : AceProviderLocator +public class AceXlsProviderLocator : AceProviderLocator { public AceXlsProviderLocator() : base("Excel 8.0") { } } [ProviderSpecialization("xlsx")] -internal class AceXlsxProviderLocator : AceProviderLocator +public class AceXlsxProviderLocator : AceProviderLocator { public AceXlsxProviderLocator() : base("Excel 12.0 Xml") { } } [ProviderSpecialization("xlsm")] -internal class AceXlsmProviderLocator : AceProviderLocator +public class AceXlsmProviderLocator : AceProviderLocator { public AceXlsmProviderLocator() : base("Excel 12.0 Macro") { } } [ProviderSpecialization("xlsb")] -internal class AceXlsbProviderLocator : AceProviderLocator +public class AceXlsbProviderLocator : AceProviderLocator { public AceXlsbProviderLocator() : base("Excel 12.0") { } } diff --git a/DubUrl.OleDb/Providers/MssqlNCliProviderLocator.cs b/DubUrl.OleDb/Providers/MssqlNCliProviderLocator.cs index 0182cf9e..1abed069 100644 --- a/DubUrl.OleDb/Providers/MssqlNCliProviderLocator.cs +++ b/DubUrl.OleDb/Providers/MssqlNCliProviderLocator.cs @@ -14,7 +14,7 @@ namespace DubUrl.OleDb.Providers; [AlternativeProvider()] -internal class MssqlNCliProviderLocator : BaseProviderLocator +public class MssqlNCliProviderLocator : BaseProviderLocator { internal class MssqlNCliProviderRegex : BaseProviderRegex { diff --git a/DubUrl.OleDb/Providers/MssqlOleDbProviderLocator.cs b/DubUrl.OleDb/Providers/MssqlOleDbProviderLocator.cs index 66b79f81..65caa99f 100644 --- a/DubUrl.OleDb/Providers/MssqlOleDbProviderLocator.cs +++ b/DubUrl.OleDb/Providers/MssqlOleDbProviderLocator.cs @@ -13,7 +13,7 @@ namespace DubUrl.OleDb.Providers; [Provider()] -internal class MssqlOleDbProviderLocator : BaseProviderLocator +public class MssqlOleDbProviderLocator : BaseProviderLocator { internal class MssqlOleDbProviderRegex : BaseProviderRegex { diff --git a/DubUrl.OleDb/Providers/MySqlProviderLocator.cs b/DubUrl.OleDb/Providers/MySqlProviderLocator.cs index a1af6f19..0da98550 100644 --- a/DubUrl.OleDb/Providers/MySqlProviderLocator.cs +++ b/DubUrl.OleDb/Providers/MySqlProviderLocator.cs @@ -12,7 +12,7 @@ namespace DubUrl.OleDb.Providers; [Provider()] -internal class MySqlProviderLocator : BaseProviderLocator +public class MySqlProviderLocator : BaseProviderLocator { internal class MySqlProviderRegex : BaseProviderRegex {