Open Closed

How to Use IBM i (Db2) with ABP Framework – Compatible EF Core Version? #9461


User avatar
0
Rishi1532 created

Hello Team,

I am working on a project using the following setup: ABP Studio Installed Version: 0.9.26 ABP CLI Version: 9.1.1 .NET Version: 9.0 Entity Framework Core Version: 9.x (default) My requirement is to connect the solution to an IBM i (AS/400) Db2 database instead of the default PostgreSQL provider. To do this, I need to use the Aumerial.Data.NTI package: https://www.nuget.org/packages/Aumerial.Data.Nti Since EF Core does not officially support IBM i, I’m considering using the Aumerial.EntityFrameworkCore provider.

I would appreciate your guidance on the following:

  1. Which version of Entity Framework Core is fully compatible with Aumerial.EntityFrameworkCore?
  2. If I use a compatible version of Entity Framework Core that works with Aumerial, will I be able to continue using ABP Framework 9.1.1 without issues in my project setup?
  3. What is the recommended approach to use IBM i Db2 in ABP projects?

Looking forward to your guidance. Rishikesh


8 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. The ABP Framework does not provide a built-in integration for IBM i (Db2) databases. However, ABP is designed to be database-agnostic at its core, allowing you to use any EF Core-compatible provider. According to the official documentation, you can use any database system by integrating its libraries and APIs, as long as you implement the necessary repository interfaces if you want to use ABP's pre-built modules.

    2. The compatibility between Aumerial.EntityFrameworkCore and Entity Framework Core depends on the version supported by the Aumerial provider. You should check the Aumerial.EntityFrameworkCore documentation or NuGet page to determine which EF Core versions are supported. ABP 9.1.1 uses EF Core 9.x by default, so you must ensure that Aumerial.EntityFrameworkCore is compatible with EF Core 9.x. If it only supports an earlier EF Core version, you may need to downgrade EF Core packages in your ABP solution to match the supported version.

    3. If you use a compatible version of EF Core with Aumerial.EntityFrameworkCore, you can continue using ABP Framework 9.1.1. However, you must ensure that all ABP modules and your project dependencies are aligned with the EF Core version you choose. If you downgrade EF Core, you may need to adjust ABP package versions accordingly.

    4. The recommended approach to use IBM i Db2 in ABP projects is:

      • Integrate the Aumerial.EntityFrameworkCore provider into your solution.
      • Configure your DbContext to use the IBM i Db2 provider.
      • If you use ABP pre-built modules, you may need to implement custom repository interfaces if those modules do not support your provider out of the box.
      • Test your application thoroughly to ensure compatibility.

    Example configuration in your module:

    [DependsOn(typeof(AbpEntityFrameworkCoreModule))]
    public class MyProjectEntityFrameworkCoreModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAbpDbContext<MyDbContext>(options =>
            {
                options.AddDefaultRepositories();
            });
    
            Configure<AbpDbContextOptions>(options =>
            {
                options.UseNtiDb2(); // Replace with the actual method from Aumerial.EntityFrameworkCore
            });
        }
    }
    

    Replace UseNtiDb2 with the actual extension method provided by the Aumerial package.

    Sources:

    • https://abp.io/docs/latest/others/why-abp-platform

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    From https://www.aumerial.com/de/ressource/nti-ef-toolbox-en.pdf I can see it compatiable with EF Core 8, ABP 8.x use EF Core 8

  • User Avatar
    0
    Rishi1532 created

    Hi Thank you for the helpful responses.

    Since the Aumerial.EntityFrameworkCore provider is compatible with EF Core 8, I understand that I’ll need to downgrade my ABP solution to an earlier version that also uses EF Core 8.

    Could you please confirm which ABP Framework version (e.g., 8.x.x) would be the most stable and compatible for working with EF Core 8 and the Aumerial provider for IBM i (Db2)?

    I’d like to ensure I’m using a version that maintains long-term support and minimal compatibility issues with the rest of the ABP ecosystem.

    Thanks again for your support!

  • User Avatar
    0
    Rishi1532 created

    Hi

    Additionally, I’ve updated the DbContextFactory and EntityFrameworkCoreModule files to use .UseNTi(...) as per the Aumerial provider's documentation. Could you kindly confirm if these changes will work as expected, or if there’s anything else I need to adjust for full compatibility?


    DbContextFactory

    using System.IO; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; using Aumerial.EntityFrameworkCore; // Check Aumerial's NuGet package

    namespace NTIDemo.EntityFrameworkCore;

    public class NTIDemoDbContextFactory : IDesignTimeDbContextFactory<NTIDemoDbContext> { public NTIDemoDbContext CreateDbContext(string[] args) { var configuration = BuildConfiguration();

        NTIDemoEfCoreEntityExtensionMappings.Configure();
    
        var builder = new DbContextOptionsBuilder&lt;NTIDemoDbContext&gt;()
            .UseNTi(configuration.GetConnectionString("Default")); // Replace with Aumerial's method
    
        return new NTIDemoDbContext(builder.Options);
    }
    
    private static IConfigurationRoot BuildConfiguration()
    {
        var builder = new ConfigurationBuilder()
            .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../NTIDemo.DbMigrator/"))
            .AddJsonFile("appsettings.json", optional: false);
    
        return builder.Build();
    }
    

    }


    EntityFrameworkCoreModule

    using System; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Uow; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.BackgroundJobs.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.BlobStoring.Database.EntityFrameworkCore; using Volo.Abp.LanguageManagement.EntityFrameworkCore; using Volo.FileManagement.EntityFrameworkCore; using Volo.Abp.TextTemplateManagement.EntityFrameworkCore; using Volo.Saas.EntityFrameworkCore; using Volo.Abp.Gdpr; using Volo.Chat.EntityFrameworkCore; using Volo.Abp.Studio; using Aumerial.EntityFrameworkCore; using Microsoft.Extensions.Configuration;

    namespace NTIDemo.EntityFrameworkCore;

    [DependsOn( typeof(NTIDemoDomainModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpBackgroundJobsEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpIdentityProEntityFrameworkCoreModule), typeof(AbpOpenIddictProEntityFrameworkCoreModule), typeof(LanguageManagementEntityFrameworkCoreModule), typeof(FileManagementEntityFrameworkCoreModule), typeof(SaasEntityFrameworkCoreModule), typeof(ChatEntityFrameworkCoreModule), typeof(TextTemplateManagementEntityFrameworkCoreModule), typeof(AbpGdprEntityFrameworkCoreModule), typeof(BlobStoringDatabaseEntityFrameworkCoreModule) )] public class NTIDemoEntityFrameworkCoreModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic

        NTIDemoEfCoreEntityExtensionMappings.Configure();
    }
    
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAbpDbContext&lt;NTIDemoDbContext&gt;(options =>
        {
                /* Remove "includeAllEntities: true" to create
                 * default repositories only for aggregate roots */
            options.AddDefaultRepositories(includeAllEntities: true);
        });
    
        if (AbpStudioAnalyzeHelper.IsInAnalyzeMode)
        {
            return;
        }
    
        Configure&lt;AbpDbContextOptions&gt;(options =>
        {
            options.Configure&lt;NTIDemoDbContext&gt;(context =>
            {
                var configuration = context.ServiceProvider.GetRequiredService&lt;IConfiguration&gt;();
                context.DbContextOptions.UseNTi(configuration.GetConnectionString("Default"));
            });
        });
    
    
    
    }
    

    }

    Looking forward to your guidance.

    Best regards, Rishikesh

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The latest 8.x version is 8.3.4

    https://www.nuget.org/packages/Volo.Abp.EntityFrameworkCore/8.3.4

    Your code seems to have no problem. You can run it. Feel free to provide feedback on any exceptions/problems.

    Thanks.

  • User Avatar
    0
    alper created
    Support Team Director

    did you solve it? and how?

  • User Avatar
    0
    Rishi1532 created

    [maliming] said: hi

    The latest 8.x version is 8.3.4

    https://www.nuget.org/packages/Volo.Abp.EntityFrameworkCore/8.3.4

    Your code seems to have no problem. You can run it. Feel free to provide feedback on any exceptions/problems.

    Thanks.

    hi, Thanks this solved my issue

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Great 👍

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on July 08, 2025, 08:19