Page 1 of 1

Problem with DB-First .NET Core

Posted: Tue 27 Aug 2019 13:39
by pikinier20
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?

Re: Problem with DB-First .NET Core

Posted: Wed 28 Aug 2019 16:51
by Shalex
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.