Search code examples
c#oracleentity-frameworkentity-framework-6odac

Entity Framework is not generating entity classes


  • Entity Framework: 6.4
  • Oracle Managed Data Access: 19.7
  • Oracle Managed Data Access Entity Framework: 19.7
  • Visual Studio: 2019
  • Oracle database: 11g

Entity Framework Wizard is working without any problems, but after I click finish, after a couple of seconds of loading I get this:

enter image description here

Model.tt hasn't generated any clases, and in output window all it says is there have been errors, check the Model.edmx, but those errors are about it failing to generate classes for some views without primary keys, and are errors I get even when it generates the rest of the tables fine.

The error is probably in the database, because it generates the model for an older version of the schema. I have tried reinstalling Entity Framework, generating on different machines... One time I dropped some newly added procedures and it managed to generate the model, but the second time, when I reimported the schema and dropped those same procedures again, it failed.

I don't know if anything is different on newer Oracle versions, but working with Entity on 11g has been a pain in the butt.


Solution

  • Found it.

    ...

    After going through every change between new and old schema, I discovered there are foreign key constraints with different types, NUMBER(1) and NUMBER(10). I have known from before that EF doesn't support this, so thanks for that.

    Why did this had to break the model generation, I don't know. Only if there's was any error reporting...