Problem with DB-First .NET Core

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
pikinier20
Posts: 1
Joined: Tue 27 Aug 2019 13:25

Problem with DB-First .NET Core

Post by pikinier20 » Tue 27 Aug 2019 13:39

Hello,
I've got some problems with generating entity model for Oracle database in .NET Core project. I will start with information that we have no full access to database, we've got only access to filtered views of tables with no primary key column inside. So far, we used only usual .NET projects and dotConnect as well as Entity Developer worked perfectly. The problem comes only when I try to create Devart EF Core model. Tool doesn't generate any class and throws error: "Entity type class 'XXX' has no primary key.". Are there any solutions/switches to make it work?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with DB-First .NET Core

Post by Shalex » Wed 28 Aug 2019 16:51

EF Core engine requires a primary key to be defined in a class. If your class includes a property that corresponds to the PK column in your database, set Primary Key=True for this property in Entity Developer.

Refer to https://stackoverflow.com/questions/435 ... rimary-key.

Post Reply