Register your database provider
Componyx.Data opens connections through DbProviderFactories, resolved by an invariant
provider name. On .NET Framework this was registered automatically through
machine.config. On .NET Core and later, register the factory yourself once at startup,
before the first DAL is created.
using System.Data.Common;
using Microsoft.Data.SqlClient;
Componyx.Data.DAL.DefaultProviderName = "Microsoft.Data.SqlClient";
DbProviderFactories.RegisterFactory("Microsoft.Data.SqlClient", SqlClientFactory.Instance);
Use the invariant name and factory instance that match your database's ADO.NET provider package
(Npgsql for PostgreSQL, MySqlConnector for MySQL and so on). Setting
DefaultProviderName here means you do not need to pass a provider name to every
DAL you construct afterward, it falls back to this automatically.