Last update:
January 30, 2024
Transforming Custom Module to Support DB Agnostic Approach¶
To transform your custom module to support DB agnostic approach:
- Add new Data.[Provider] projects.
- Add Project references.
- Add Packages for specific database provider:
- MySql - Pomelo.EntityFrameworkCore.MySql 6.0.0
- PostgreSql - Npgsql.EntityFrameworkCore.PostgreSQL 6.0.0
- Sql Server - Microsoft.EntityFrameworkCore.SqlServer
- Copy and update:
- DbContextOptionsBuilderExtensions.cs
- PostgreSqlDbContextFactory.cs
- Readme.md
- Add DB Agnostic AddDbContext in Module.Initialize.
- Add customization extension OnModelCreating to allow configuration of an entity type for different database types.
- Refactor and isolate raw Sql server code.
- Copy Migrations from Data to SqlServer.
- Create new Migrations.
- Compile, compress, and test.