Write C# code
EF Core handles the SQL for DB2 for i
With the Entity Framework Core extension from NTi Data Provider, seamlessly map your .NET objects to DB2 for i database structures and back, without writing a single line of SQL.
| Column | Type |
|---|---|
| PKID | INTEGER |
| NAME | VARCHAR(255) |
| VARCHAR(255) | |
| BIRTHDATE | DATE |
DB2 for i
with .NET standards
With EF Core, work as you would with any modern database.
One codebase, multiple databases
With EF Core, your application code is independent from the DBMS. The SQL is generated automatically based on the target database.
Standard .NET development
Same environment and same tools as a standard .NET project. NTi handles IBM i data access.
Zero impact on the IBM i side
EF Core coexists with your existing IBM i developments. Your current SQL queries can be preserved.
Widely available skills
.NET developers already know EF Core. They can work on IBM i with no specific training required.
Develop at the speed of modern .NET
Work with DB2 for i directly in C#. EF Core handles the data access layer and generates optimized SQL queries for you.
-
Native LINQ support
LINQ is the native C# way to query data through typed expressions, with auto-completion and compile-time validation. EF Core leverages LINQ to automatically generate SQL tailored to DB2 for i.
-
Automated CRUD operations
EF Core generates create, read, update and delete operations automatically, and handles joins and complex relationships.
-
Optimized and secure SQL
EF Core automatically generates typed and parameterized SQL queries tailored to DB2 for i. This ensures performance, data consistency and protection against SQL injection.
List<User> users = await context.Users
.Where(u => u.Name == "Smith")
.ToListAsync();
SELECT *
FROM USERS
WHERE NAME = 'Smith';
An extension
purpose-built for IBM i
Accurate DB2 type mapping
Native support for IBM i encodings (EBCDIC, Unicode) and exact mapping of DB2 for i types (CHAR, DECIMAL, DATE, etc.) to .NET types, including scalar function handling.
Modern SQL
Leverage the DB2 for i SQL engine: integrity constraints, relationships and indexes are managed by the native DB2 for i engine. EF Core leverages these capabilities directly, without reimplementing them on the application side.
Schema management
Precisely target the IBM i libraries used by your application. Schema configuration is handled on the .NET side, while respecting the existing database organization.
DB First or Code First
You choose
DB First
Application modernizationFrom an existing database and with a single command, automatically generate the data access layer and the interface elements of your .NET application.
Key features
- Automatic scaffolding from an existing database
- C# entity generation from the existing schema
- Coexists with existing structures and processes
- Compatible with existing stored procedures and processes
Code First
New projectsStarting a new application? Develop without worrying about the database: tables, columns and CRUD operations are generated automatically, without a single line of SQL.
The data model is defined by the application
- Data model defined in C#
- Schema creation and evolution via EF Core migrations
- Explicit mapping of tables, columns, and relationships
- Automatic CRUD operation generation
Native integration with the .NET ecosystem
All modern .NET features, available directly for IBM i with the EF Core extension for NTi.
ASP.NET Identity
Manage your users, roles and permissions directly on DB2 for i.
Authentification
Native support for MFA and external logins (Microsoft Entra ID, Google, Okta).
DevOps & automation
Native integration with .NET tools: NuGet, Docker, CI/CD and standardized environments.
Immediate benefits
By relying on Entity Framework Core, NTi aligns IBM i development with today's .NET standards.
Your teams work with IBM i without even realizing it.
With EF Core, .NET developers access DB2 for i natively, with no specific IBM i skills required.
Start new application projects immediately, without having to rebuild an IBM i-specific data access layer.
With the technical foundation already in place, teams move faster into functional development.
By relying on open and widely adopted standards, your new applications avoid the buildup of custom layers and one-off solutions.
The result: fewer internal dependencies, clearer maintenance and technical debt kept under control over time.
Using shared patterns and tools promotes a consistent application base across the enterprise.
This simplifies code reviews, project handovers, DevOps automation and the overall governance of your information system.
Real-world examples
Build more, code less
Modern web applications delivered faster with .NET
Context
Enable customers to view their orders online.
Data is spread across multiple IBM i tables (customers, orders, pricing).
Implementation with EF Core
- DB First approach: automatic C# code generation from existing tables
- Developers work with C# objects instead of writing SQL
- EF Core automatically generates joins between tables
Results
Delivery of a modern web portal, where each customer accesses their own data according to the rules already defined in the IBM i ERP.
Context
Deploy a mobile application for on-site order pickers, with security aligned on enterprise standards.
Goal: avoid any user management specific to IBM i.
Implementation with EF Core
- .NET backend built with EF Core and DB2 for i
- ASP.NET Identity for identity management
- Authentication through Microsoft Entra ID and MFA
- .NET MAUI or Blazor applications for mobile devices
Results
Operators sign in with their Microsoft account and access the application with no IBM i identity management required.
Field operations (scanning, validation, tracking) are synchronized directly with DB2 for i through EF Core.
Context
A monolithic IBM i ERP that has become difficult to evolve. The need to isolate specific features (e.g. shipping, logistics tracking) quickly, without impacting the core application.
Implementation with EF Core
- Targeted extraction of a feature into a standalone .NET service
- Service deployment in a Docker container
- Access to IBM i data through EF Core, with no duplication
- Independent API, consumable by other applications
Results
The isolated feature evolves, tests and deploys independently.
The IBM i ERP stays stable while continuing to handle data persistence.
Any questions?
Yes.
Through NTi, the Entity Framework Core extension can be used natively with DB2 for i, just like with any modern relational database such as SQL Server, Oracle or PostgreSQL.
NTi provides:
- An IBM i ADO.NET provider, fully compliant with the contracts expected by .NET and EF Core.
- A dedicated Entity Framework Core extension, purpose-built for DB2 for i.
C# entities are mapped directly to existing tables, with no schema changes, no data duplication and no direct exposure of the IBM i database.
Yes, provided you have a provider capable of translating LINQ expressions into DB2 for i-specific SQL.
The EF Core extension shipped with NTi is designed to meet this requirement.
It handles:
- SQL generation tailored to DB2 for i.
- Accurate mapping of DB2 data types to .NET types.
- Transaction management.
- IBM i library (schema) management.
The behavior is aligned with standard Entity Framework Core mechanisms: EF Core remains database-agnostic, while the translation is handled by the NTi provider..
No, the approach is progressive and non-intrusive.
The NTi EF Core extension is an abstraction layer that generates SQL, but imposes no paradigm shift.
EF Core can be used wherever it delivers a productivity gain, while preserving:
- Existing SQL queries.
- Stored procedures.
- Existing IBM i programs and processes.
This hybrid approach allows EF Core to be introduced gradually, without disrupting existing business logic or the IBM i application assets.
EF Core is a data access layer that sits between the .NET application code and the relational database. It is therefore naturally suited to applications that consume, expose or transform business data.
With the NTi EF Core extension, Entity Framework Core is used on the .NET backend to build:
- Web applications (ASP.NET Core).
- REST APIs.
- Business services.
- Microservices-oriented architectures.
These backends can then power:
- Web applications.
- Mobile applications.
- Other client applications.
DB2 for i remains the system of record, while applications benefit from the development, tooling and automation standards of the entire .NET ecosystem.
Yes.
The NTi EF Core extension relies on the .NET runtime and the NTi provider itself, making it compatible with the standard execution environments of the .NET world.
Applications using EF Core with NTi can run on:
- Windows.
- Linux.
- Docker containers.
- CI/CD automation and deployment pipelines.
.NET applications run in modern, standardized environments (server, container or cloud) while accessing IBM i through NTi. IBM i remains the data backend, while the application stays fully portable and independent from the runtime infrastructure.