Oracle.EntityFrameworkCore 2.19.30
Oracle.EntityFrameworkCore NuGet Package Version 2.19.30 README
Release Notes: ODP.NET Entity Framework Core
July 2019
This document provides information that supplements the ODP.NET Entity Framework Core documentation. This product's license agreement is available at https://www.oracle.com/downloads/licenses/distribution-license.html
TABLE OF CONTENTS *New Features *Bug Fixes *Documentation Corrections and Additions *Tips, Limitations, and Known Issues
New Features
This is the first production release.
Bug Fixes since Oracle.EntityFrameworkCore NuGet Package 2.19.0-beta4
29884678 SCAFFOLDING HAVING SLOW PERFORMANCE 29869460 MIGRATIONS RESULT IN SQL MISSING RIGHT PARENTHESIS ERROR WHEN ADDING DATETIME FIELD 29869371 INDEX OUT OF RANGE ERROR WHEN SAVING ENTITY TO CONTEXT 11.2 29822270 MIGRATIONS RESULT IN ORA-00942: TABLE OR VIEW DOES NOT EXIST WHEN TABLE EXISTS IN ANOTHER SCHEMA 29817077 LINQ QUERY RESULTS IN ORA-12704: CHARACTER SET MISMATCH 29798061 INCORRECT RESULTS WHEN SELECTING FOR NON-NULL VALUES 29683096 DBUPDATECONCURRENCYEXCEPTION FROM SAVECHANGESASYNC WHEN SAVING MORE THAN ONE ROW 28963848 FILTER SCHEMA DOES NOT WORK WITH DIFFERENT SCHEMA
Documentation Corrections and Additions
None
Tips, Limitations, and Known Issues
Code First
- The HasIndex() Fluent API cannot be invoked on an entity property that will result in a primary key in the Oracle database. Oracle Database does not support index creation for primary keys since an index is implicitly created for all primary keys.
- Oracle Database 11.2 does not support default expression to reference any PL/SQL functions nor any pseudocolumns such as '
.NEXTVAL'. As such, HasDefaultValue() and HasDefaultValueSql() Fluent APIs cannot be used in conjunction with 'sequence.NETVAL' as the default value, for example, with the Oracle Database 11.2. However, the application can use the UseOracleIdentityColumn() extension method to have the column be populated with server generated values even for Oracle Database 11.2. Please read about UseOracleIdentityColumn() for more details.
Computed Columns
Literal values used for computed columns must be encapsulated by two single-quotes. In the example below, the literal string is the comma. It needs to be surrounded by two single-quotes as shown below.
// C# - computed columns code sample modelBuilder.Entity
() .Property(b => b.BlogOwner) .HasComputedColumnSql(""LastName" || '','' || "FirstName"");
Database Scalar Function Mapping
- Database scalar function mapping does not provide a native way to use functions residing within PL/SQL packages. To work around this limitation, map the package and function to an Oracle synonym, then map the synonym to the EF Core function.
LINQ
- Oracle Database 12.1 has the following limitation: if the select list contains columns with identical names and you specify the row limiting clause, then an ORA-00918 error occurs. This error occurs whether the identically named columns are in the same table or in different tables.
Let us suppose that database contains following two table definitions:
- SQL> desc X; Name Null? Type
COL1 NOT NULL NUMBER(10) COL2 NVARCHAR2(2000)
SQL> desc Y; Name Null? Type
COL0 NOT NULL NUMBER(10) COL1 NUMBER(10) COL3 NVARCHAR2(2000)
Executing the following LINQ, for example, would generate a select query which would contain "COL1" column from both the tables. Hence, it would result in error ORA-00918: dbContext.Y.Include(a => a.X).Skip(2).Take(3).ToList(); This error does not occur when using Oracle Database 11.2, 12.2, and higher versions.
- The filter property for a DatabaseIndex always returns NULL. For example, let us create the following table with a unique index:
CREATE TABLE FilteredIndexTable (Id1 number, Id2 number NULL); CREATE UNIQUE INDEX IX_UNIQUE ON FilteredIndexTable (CASE WHEN Id2 > 10 THEN Id2 ELSE NULL END);
If indexes are attempted to be obtained, then executing index.Filter will return null.
var index = dbModel.Tables.Single().Indexes;
- Certain LINQs cannot be executed against Oracle Database 11.2. Let us first imagine an Entity Model with the following entities:
public class Gear
{
public string FullName { get; set; }
public virtual ICollection
public class Weapon { public int Id { get; set; } public bool IsAutomatic { get; set; } public string OwnerFullName { get; set; } public Gear Owner { get; set; } }
The following LINQ will not work against Oracle Database 11.2:
dbContext.Gear.Include(i => i.Weapons).OrderBy(o => o.Weapons.OrderBy(w => w.Id).FirstOrDefault().IsAutomatic).ToList();
This is due to LINQ creating the following SQL query:
SELECT "i"."FullName" FROM "Gear" "i" ORDER BY ( Select K0 "IsAutomatic" from( SELECT "w"."IsAutomatic" K0 FROM "Weapon" "w" WHERE ("i"."FullName" = "w"."OwnerFullName") ORDER BY "w"."Id" NULLS FIRST ) "m1" where rownum <= 1 ) NULLS FIRST, "i"."FullName" NULLS FIRST
Within the SELECT statement, there are two nested SELECTs. The generated SQL will encounter a ORA-00904 : "invalid identifier" error with Oracle Database 11.2 since it has a restriction where it does not recognize outer select table alias "i" in the inner nested select query.
'Invalid column name' error when executing LINQ against a table that contains a column name with NLS (Unicode) characters. Let us first imagine an Entity Model with the following entity: [Table("Tags")] public class Tag { [Key] public decimal tagId { get; set; } public String name { get; set; } public int rating { get; set; }
String ToString() { return $"{tagId}, {name}"; } } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<Tag>( b => { b.ToTable("Tags"); b.Property(o => o.rating).HasColumnName("?ating"); }); }
The following LINQ will generate an 'Invalid column name' error. var z = (from o in db.Tags.Select(b => new { b.rating, b.tagId }).OrderBy(x => x.tagId).Distinct().GroupBy(y => y.tagId) select o);
This issue requires a fix in Microsoft�s �Relational� nuget package. https://github.com/aspnet/EntityFrameworkCore/issues/15904
Migrations
- The UInt64 data type is not supported for Entity Framework Core Migrations.
- If more than one column is associated with any sequence/trigger, then ValueGeneratedOnAdd() Fluent API will be generated for each of these columns when performing a scaffolding operation. If we then use this scaffolded model to perform a migration, then an issue occurs. Each column associated with the ValueGeneratedOnAdd() Fluent API is made an identity column by default. To avoid this issue, use UseOracleSQLCompatibility("11") which will force Entity Framework Core to generate triggers/sequences instead.
Scaffolding
- Scaffolding a table that uses Function Based Indexes is supported. However, the index will NOT be scaffolded.
- HasColumnType and IsFixedLength Fluent API is not generated while scaffolding a table with a NCHAR column. This issue requires a fix in Microsoft�s �Relational� nuget package. https://github.com/aspnet/EntityFrameworkCore/issues/14160 https://github.com/aspnet/EntityFrameworkCore/issues/15772
Sequences
- A sequence cannot be restarted.
- Extension methods related to SequenceHiLo is not supported.
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
Showing the top 20 packages that depend on Oracle.EntityFrameworkCore.
Packages | Downloads |
---|---|
EFCore.BulkExtensions.Oracle
Package Description
|
13 |
Any 0.0
- Microsoft.EntityFrameworkCore.Relational (>= 2.2.4 && < 3.0.0)
- Oracle.ManagedDataAccess.Core (>= 2.19.31 && < 2.20.0)
Version | Downloads | Last updated |
---|---|---|
9.23.90 | 1 | 07/20/2025 |
9.23.80 | 7 | 04/16/2025 |
9.23.60 | 19 | 12/18/2024 |
8.23.90 | 1 | 07/18/2025 |
8.23.80 | 7 | 04/17/2025 |
8.23.70 | 13 | 01/07/2025 |
8.23.60 | 21 | 10/04/2024 |
8.23.50 | 17 | 09/11/2024 |
8.23.40 | 16 | 05/20/2024 |
8.21.190 | 1 | 07/20/2025 |
8.21.180 | 6 | 04/17/2025 |
8.21.170 | 12 | 01/07/2025 |
8.21.160 | 16 | 10/04/2024 |
8.21.150 | 19 | 08/04/2024 |
8.21.140 | 19 | 04/13/2024 |
8.21.121 | 19 | 02/08/2024 |
7.21.13 | 20 | 02/08/2024 |
7.21.12 | 21 | 02/08/2024 |
7.21.11 | 33 | 02/08/2024 |
7.21.9 | 18 | 02/07/2024 |
7.21.8 | 17 | 02/07/2024 |
6.23.3-dev | 19 | 02/05/2024 |
6.23.2-dev | 20 | 02/05/2024 |
6.21.170 | 10 | 01/07/2025 |
6.21.160 | 18 | 10/04/2024 |
6.21.150 | 20 | 08/18/2024 |
6.21.140 | 18 | 04/13/2024 |
6.21.130 | 20 | 02/08/2024 |
6.21.120 | 18 | 02/08/2024 |
6.21.110 | 27 | 02/08/2024 |
6.21.90 | 21 | 02/08/2024 |
6.21.61 | 29 | 10/27/2022 |
6.21.5 | 842 | 01/10/2022 |
6.21.4 | 70 | 12/15/2021 |
5.21.90 | 20 | 02/08/2024 |
5.21.61 | 19 | 02/08/2024 |
5.21.5 | 18 | 02/07/2024 |
5.21.4 | 20 | 02/07/2024 |
5.21.1 | 70 | 03/11/2021 |
3.21.90 | 19 | 02/08/2024 |
3.21.61 | 19 | 02/08/2024 |
3.21.5 | 21 | 02/07/2024 |
3.21.4 | 82 | 12/14/2021 |
3.19.180 | 22 | 02/08/2024 |
3.19.130 | 33 | 12/14/2021 |
3.19.110 | 21 | 02/08/2024 |
3.19.80 | 277 | 11/05/2020 |
3.19.0-beta1 | 21 | 07/07/2020 |
2.19.180 | 18 | 02/08/2024 |
2.19.110 | 20 | 02/08/2024 |
2.19.90 | 20 | 02/08/2024 |
2.19.80 | 35 | 02/08/2024 |
2.19.70 | 20 | 07/04/2020 |
2.19.60 | 21 | 02/08/2024 |
2.19.50 | 23 | 02/08/2024 |
2.19.30 | 19 | 02/20/2020 |