IBM.EntityFrameworkCore
9.0.0.400
dotnet add package IBM.EntityFrameworkCore --version 9.0.0.400
NuGet\Install-Package IBM.EntityFrameworkCore -Version 9.0.0.400
<PackageReference Include="IBM.EntityFrameworkCore" Version="9.0.0.400" />
<PackageVersion Include="IBM.EntityFrameworkCore" Version="9.0.0.400" />
<PackageReference Include="IBM.EntityFrameworkCore" />
paket add IBM.EntityFrameworkCore --version 9.0.0.400
#r "nuget: IBM.EntityFrameworkCore, 9.0.0.400"
#:package IBM.EntityFrameworkCore@9.0.0.400
#addin nuget:?package=IBM.EntityFrameworkCore&version=9.0.0.400
#tool nuget:?package=IBM.EntityFrameworkCore&version=9.0.0.400
About
IBM.EntityFrameworkCore is a NuGet package that serves as the IBM Data Server provider for Entity Framework Core, enabling .NET applications to interact seamlessly with IBM database servers.
Key Features
Compatibility: Targets .NET 8.0, ensuring compatibility with applications running on this framework or higher.
Dependencies: Requires Microsoft.EntityFrameworkCore.Relational (version 9.0.1 or higher) and Net.IBM.Data.Db2 (version 9.0.0.300 or higher).
How to use
Use package manager to add package to the project, build it and deploy it as any other .NET NuGet package based deployment.
In cases where Db2Connect license is needed, the license file needs to be copied to clidriver/license folder of Net.IBM.Data.Db2** package as detailed here:
https://community.ibm.com/community/user/blogs/vishwa-hs1/2020/07/12/db2-net-packages-download-and-configure
Main Types
All ADO.NET Entity Framework (ORM) specification types.
What's New
v9.0.0.400
� Issue Fixes: During insert operations, Linq queries may retrieve incorrect identity column values if identity generation has been restarted or is not configured to generate values in ascending order.
To ensure correct retrieval of identity values, the INSERT statement should be combined with a SELECT statement using the FINAL TABLE syntax. For example;
SELECT ID, COLROW FROM FINAL TABLE ( INSERT INTO DUMMYSCHEMA.DUMMYTAB1 (NAME) VALUES (@p8));
Note: This syntax is supported in Db2 for z/OS version 12.01 or later.
Configuration for Db2 12.01: If user application targets Db2 for z/OS 12.01, configure the server version explicitly:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseDb2(connectionString, x => x.SetServerInfo(IBMDBServerType.OS390, IBMDBServerVersion.OS390_12_01));
� Multivalue Insert Support: Db2 for z/OS 13.01 and later supports multivalue insert statements.
Linq Query for Table with Identity Column: Generates SQL using FINAL TABLE to retrieve identity values:
SELECT ID, COLROW FROM FINAL TABLE (INSERT INTO DUMMYSCHEMA.DUMMYTAB1 (NAME)
VALUES (@p8), (@p9), (@p10));
Linq Query for Table without Identity Column: Generates a standard multivalue INSERT statement:
INSERT INTO DUMMYSCHEMA.DUMMYTAB1 (NAME)
VALUES (@p8), (@p9), (@p10);
Configuration for Db2 13.01: As the default server version is 13.01, no explicit configuration is needed:
optionsBuilder.UseDb2(connectionString, x => x.SetServerInfo(IBMDBServerType.OS390));
Note: If the same application also targets Db2 for z/OS 12.01, using multivalue insert syntax may result in a syntax error. Ensure compatibility by configuring the target version.
v9.0.0.300
� With this version, OFFSET clause is supported for Db2 for LUW, Db2 for IBM i and Db2 for z/OS.
Note:
� To use OFFSET clause, UseRowNumberForPaging() should not be configured in context class.
For example:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseDb2(ConnectionString, p => { p.SetServerInfo(IBMDBServerType.AS400); });
}
� If UseRowNumberForPaging() is configured, the older mechanism using ROW_NUMBER() will be applied instead.
� There are server-side limitations. For example, in the case of Db2 for z/OS, using OFFSET within a subselect may not work.
Linq Query:
� context.SampleTable.OrderBy(o => o.SAMPLEID).Skip(2).ToList();
Generated sql:
SELECT a.ID, a.SAMPLEID, a.EMPLOYEEID
FROM SAMPLETABLE AS a
ORDER BY a.SAMPLEID OFFSET @__p_0 ROWS
Suggestion:
� If the column used in the OrderBy clause contains duplicate values, the result may be inconsistent.
To ensure consistent ordering and predictable paging, it is recommended to include additional columns in the OrderBy clause.
v9.0.0.200
� With this version, Code First support for Db2 for LUW and Db2 for z/OS is included. v9.0.0.100 version had support for Database First.
v9.0.0.100
� Support for Microsoft EF Core 9
� Issue Fixes: The LINQ query may fail with SQL0104N error, when EF application uses table entities, configured with SMALLINT(2) data type against DB2 for z/os database. For example:
LINQ Query:
_dbContext.Smalltabs.Where(x =>x.IncnstDspstnNoted !=1);
Entity Configuration:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Smalltab>(entity =>
{
entity
.HasNoKey()
.ToTable("SMALLTAB", "SCHEMA1");
entity.Property(e => e.IncnstDspstnNoted)
.HasColumnType("smallint(2)") //this causes wrong SQL generation
.HasColumnName("INCNST_DSPSTN_NOTED");
entity.Property(e => e.ItemId)
.HasColumnType("bigint(8)")
.HasColumnName("ITEM_ID");
});
}
Related Packages
� IBM.EntityFrameworkCore : Windows x64
� IBM.EntityFrameworkCore-lnx. : Linux AMD64
� IBM.EntityFrameworkCore-osx : Mac ARM64 M1/M2/M3
� Net.IBM.EntityFrameworkCore-ppc : Linux ppc64le
How to enable logging
To enable Entity Framework Core (EF Core) logging, applications can be configured to use the simple built-in logging system as detailed here:
https://learn.microsoft.com/en-us/ef/core/logging-events-diagnostics/simple-logging
Requesting support
Please reach out to IBM Tech support for any issues in using this package:
https://www.ibm.com/mysupport/s/?language=en_US
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.1)
- Net.IBM.Data.Db2 (>= 9.0.0.400)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on IBM.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
Eltra.EntityFramework
Library for Eltra .Net |
|
|
BizDoc.Infrastructure.SAP
SAP for BizDoc |
|
|
Carbon.Kit.Data.DB2
Provides interfaces, abstractions and common functions to support working with IBM DB2. |
|
|
Carbon.Feature.Components.IBM
Feature with various supported Carbon Components and IBM. |
|
|
HyperDev.Data.DB2
HyperDev Fatum Framework |
GitHub repositories
This package is not used by any popular GitHub repositories.
IBM Data Server provider support for Entity Framework Core. For more details, please visit: https://community.ibm.com/community/user/blogs/vishwa-hs1/2020/07/12/db2-net-packages-download-and-configure