Instead of adding the IUnitOfWork through the service factory
services.AddTransient<IUnitOfWork>(_ => new UnitOfWork("connectionString"));
The IUnitOfWork
contract is added to the service collection using the PersistenceExtension
methods instead. This new feature allows us to switch between a Postgres Server or an Sql Server.
services.AddDatabase(builder => {
builder.UseNpgsql("connectionString")
})
This initially features support for Postgres using Npgsql
and SqlServer using System.Data.SqlClient
This additional layer is done as in the future, the UnitOfWork registration will be added as a separate library and will be utilized in this template.
Moved all local service and worker registrations to the Installers folder for parity with ApiBoilerPlate