ODP.NET Core - Scaffold DB-Context

I experienced the problems that you experienced, even after downloading the ODP.NET Core driver for production (2.18.3, released on 20-Sept-2018 and available from nuget at https://www.nuget.org/packages/Oracle.ManagedDataAccess.Core/).

I contacted the Oracle community for help. A kind soul answered that there's another piece of the puzzle if we want to have a ready access to goodness such as "UseOracle." It is the Oracle provider for the Entity Framework Core. See the thread at https://community.oracle.com/thread/4180739.

The only other way to use it, to my knowledge and based on his answer, is the way described in the Oracle Help Center, Getting Started with ODP.NET Core (https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/ODPNET_Core_get_started/index.html).


I managed to scaffold it using

scaffold-dbcontext "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1.1.1.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=MYdb)));Persist Security Info=True;User Id=MYUSER;Password=mypass;" Oracle.EntityFrameworkCore

But it's an unusable mess. tons of errors

Could not scaffold the foreign key 'XX.TABLE1(USER_ID,USER_ID)'. A key for 'ID,ID' was not found in the principal entity type 'Aspnetusers'.

Seems like Dapper is my friend...