Oracle.EntityFrameworkCore 8.23.40

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Oracle.EntityFrameworkCore --version 8.23.40
NuGet\Install-Package Oracle.EntityFrameworkCore -Version 8.23.40
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Oracle.EntityFrameworkCore" Version="8.23.40" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Oracle.EntityFrameworkCore --version 8.23.40
#r "nuget: Oracle.EntityFrameworkCore, 8.23.40"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Oracle.EntityFrameworkCore as a Cake Addin
#addin nuget:?package=Oracle.EntityFrameworkCore&version=8.23.40

// Install Oracle.EntityFrameworkCore as a Cake Tool
#tool nuget:?package=Oracle.EntityFrameworkCore&version=8.23.40

Oracle Logo

Oracle.EntityFrameworkCore 8.23.40

Release Notes for Oracle Entity Framework Core 8 NuGet Package

April 2024

Oracle Data Provider for .NET (ODP.NET) Entity Framework (EF) Core is a database provider that allows Entity Framework Core to be used with Oracle databases. EF Core is a cross-platform Microsoft object-relational mapper that enables .NET developers to work with relational databases using .NET objects.

This document provides information that supplements the Oracle Data Provider for .NET (ODP.NET) documentation.

New Features

  • None

Bug Fixes since Oracle.EntityFrameworkCore 8.21.121

  • Bug 36179457 - ORACLE EF CORE 8 ERRORS WHEN USING OPTIMIZE COMPILE OPTION
  • Bug 35535281 - DEFAULT VALUE FOR NON-UNICODE COLUMN IS GENERATED WITH N PREFIX WHEN USING VALUE CONVERTER AND ENUM TYPE
  • Bug 36223397 - ORA-01000 TOO MANY OPENED CURSORS EVEN WHEN DBCONTEXT IS DISPOSED
  • Bug 36132873 - GUID PROPERTY RAISES A SYSTEM.NULLREFERENCEEXCEPTION

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.
  • The HasFilter() Fluent API is not supported. For example, <pre>modelBuilder.Entity<Blog>().HasIndex(b ⇒ b.Url.HasFilter("Url is not null");</pre>
  • Data seeding using the UseIdentityColumn is not supported.
  • The UseCollation() Fluent API is not supported.
  • The DateOnly and TimeOnly types are not supported.
  • DatabaseTable.Indexes() is not supported for descending indexes.
  • The following usage is not supported because of a limitation in the provider: → HasColumnType("float").HasPrecision(38). As a workaround, set the precision value in the HasColumnType() fluent API instead of explicitly using the HasPrecision() fluent API, e.g., HasColumnType("float (38)"). NOTE: Except for 38 as a precision value, other precision values between 1 and 126 can be set using the HasPrecision() Fluent API. This limitation and workaround also apply when annotations are used instead of the above mentioned fluent API's.
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. <pre> // C# - computed columns code sample modelBuilder.Entity<Blog>() .Property(b ⇒ b.BlogOwner) .HasComputedColumnSql(""LastName" || '','' || "FirstName"");

</pre>

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
  • LINQ queries that are used to query or restore historical (temporal) data are not supported.
  • LINQ queries that are used to query the DateOnly and TimeOnly types are not supported.
  • HasRowsAffectedReturnValue is not supported because Oracle does not support having a return value from a stored procedure. For example, <pre>modelBuilder.Entity<Person>() .UpdateUsingStoredProcedure( "People_Update", storedProcedureBuilder ⇒ { storedProcedureBuilder.HasRowsAffectedReturnValue(true) });</pre>
  • Certain LINQs cannot be executed against Oracle Database 21c or lower. Let us first imagine an entity model with the following entity: <pre> public class MyTable { public int Id { get; set; } public int? Value { get; set; } } </pre> The following LINQ will not work against Oracle Database 21c or lower: <pre> var query = from t in context.Table group t.Id by t.Value into tg select new { A = tg.Key, B = context.Table.Where(t ⇒ t.Value == tg.Max() * 6).Max(t ⇒ (int?)t.Id), }; </pre> This is due to LINQ creating the following SQL query: <pre> SELECT "t"."Value" "A", "t"."Id", ( SELECT MAX("t0"."Id") FROM "MyTable" "t0" WHERE (("t0"."Value" = "t"."Id") OR ("t0"."Value" IS NULL AND MAX("t"."Id") IS NULL))) "B" FROM "MyTable" "t" GROUP BY "t"."Value" </pre> The issue is because the inner select query uses a MAX function which refers to a column from the outer select query. Also the way in which the MAX function is used within the WHERE clause is not supported in Oracle Database. The same issue is also applicable when the MIN function is used.
  • Oracle DB doesn't support UPDATE queries with FROM clause in DB 21c or lower. So certain LINQs cannot be executed against Oracle Database which generate UPDATE query with FROM clause. For example, imagine an entity model with the following entities: <pre> public class Blog { public int Id { get; private set; } public string Name { get; set; } public List<Post> Posts { get; } = new(); }

public class Post { public int Id { get; private set; } public string Title { get; set; } public string Content { get; set; } public DateTime PublishedOn { get; set; } } </pre> Trying to update the Blog.Name using below LINQ would throw 'ORA-00933: SQL command not properly ended' <pre> var query = from blog in context.Set<Blog>().Where(c ⇒ c.Name == "MyBlog") join post in context.Set<Post>().Where(p ⇒ p.Title == "Oracle") on blog.Name equals post.Title select new { blog, post }; var updateQuery = query.ExecuteUpdate(s ⇒ s.SetProperty(c ⇒ c.blog.Name, "Updated")); </pre> This is due to LINQ creating the following SQL query, which Oracle database does not support. <pre> UPDATE "Blogs" "b" SET "b"."Name" = N'Updated' FROM ( SELECT "p"."Id", "p"."BlogId", "p"."Content", "p"."PublishedOn", "p"."Title" FROM "Posts" "p" WHERE "p"."Title" = N'Oracle' ) "t" WHERE (("b"."Name" = "t"."Title") AND ("b"."Name" = N'MyBlog')) </pre>

  • The PL/SQL returned by ToQueryString() does not execute successfully if the input to the LINQ query contains a TimeSpan. This is because in PL/SQL, interval value with precision is not accepted. Consider this example, imagine an entity model with the following entity: <pre> public class Author { public int Id { get; set; } public string Name { get; set; } public DateTimeOffset Timeline { get; set; } } </pre> The following LINQ will not work: <pre> var timeSpan = new TimeSpan(1000); var authorsInChigley1 = context.Authors.Where(e ⇒ e.Timeline > DateTimeOffset.Now - timeSpan).ToQueryString(); </pre> Following is the PL/SQL that gets generated. <pre> DECLARE l_sql varchar2(32767); l_cur pls_integer; l_execute pls_integer; BEGIN l_cur := dbms_sql.open_cursor; l_sql := 'SELECT "a"."Id", "a"."Name", "a"."Timeline" FROM "Authors" "a" WHERE "a"."Timeline" > (SYSDATE - :timeSpan_0)'; dbms_sql.parse(l_cur, l_sql, dbms_sql.native); dbms_sql.bind_variable(l_cur, ':timeSpan_0', INTERVAL '0 0:0:0.0001000' DAY(8) TO SECOND(7)); l_execute:= dbms_sql.execute(l_cur); dbms_sql.return_result(l_cur); END; </pre>
Scaffolding
  • Scaffolding a table that uses Function Based Indexes is supported. However, the index will NOT be scaffolded.
  • Scaffolding a table that uses Conditional Indexes is not supported.
Sequences
  • A sequence cannot be restarted.
  • Extension methods related to SequenceHiLo is not supported, except for columns with Char, UInt, ULong, and UByte data types.

Copyright (c) 2024, Oracle and/or its affiliates.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (175)

Showing the top 5 NuGet packages that depend on Oracle.EntityFrameworkCore:

Package Downloads
WalkingTec.Mvvm.Core

WalkingTec.Mvvm

FenixAlliance.ACL.Dependencies

Application Component for the Alliance Business Suite.

MPACKAGE.LibData.Oracle

Package Description

CyberEye.Constant.Lib

Package chứa các constant và enum

HanaTech.Framework.Dapper

Package Description

GitHub repositories (24)

Showing the top 5 popular GitHub repositories that depend on Oracle.EntityFrameworkCore:

Repository Stars
abpframework/abp
Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
dotnetcore/Util
Util是一个.Net平台下的应用框架,旨在提升中小团队的开发能力,由工具类、分层架构基类、Ui组件,配套代码生成模板,权限等组成。
dotnetcore/WTM
Use WTM to write .netcore app fast !!!
fullstackhero/dotnet-webapi-starter-kit
production grade .net 8 webapi starter kit with multitenancy support and clean code. 🔥
dotnet/aspire
An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
Version Downloads Last updated
8.23.40 165 5/2/2024
8.21.140 20,694 4/11/2024
8.21.121 262,535 12/8/2023
7.21.13 86,366 1/1/2024
7.21.12 249,407 10/9/2023
7.21.11 319,123 7/25/2023
7.21.9 873,599 1/19/2023
7.21.8 156,297 12/19/2022
6.21.140 1,838 4/11/2024
6.21.130 61,363 1/1/2024
6.21.120 49,238 10/9/2023
6.21.110 55,905 7/25/2023
6.21.90 339,395 1/19/2023
6.21.61 1,819,934 5/4/2022
6.21.5 905,546 1/4/2022
6.21.4 213,928 12/7/2021
5.21.90 37,119 1/19/2023
5.21.61 111,037 5/4/2022
5.21.5 171,536 1/4/2022
5.21.4 270,200 10/27/2021
5.21.1 956,631 2/12/2021
3.21.90 15,325 1/19/2023
3.21.61 48,686 5/4/2022
3.21.5 78,064 1/4/2022
3.21.4 31,313 10/27/2021
3.19.180 15,202 2/3/2023
3.19.130 105,699 10/8/2021
3.19.110 142,372 3/31/2021
3.19.80 1,176,844 9/8/2020
2.19.180 4,463 2/3/2023
2.19.110 24,428 3/31/2021
2.19.90 102,727 9/8/2020
2.19.80 161,047 7/9/2020
2.19.70 195,866 5/1/2020
2.19.60 554,310 12/6/2019
2.19.50 145,391 10/16/2019
2.19.30 513,789 7/24/2019