Error while regenerating the model from database

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
petersx
Posts: 3
Joined: Mon 24 Aug 2020 08:39

Error while regenerating the model from database

Post by petersx » Tue 25 Aug 2020 07:33

Hello,
I'm testing Devart Entity Framework for Oracle as alternative to Oracles Entity Framework.
I have installed it following the Entity Framework Tutorial in the dotConnect for Oracle Documentation.
I achieve to generate a first model with 7 tables.
To add more tables to the model, I have tried to regenerate the model from database.
First I have to wait about 10 minutes, then I catch the error message:
"An item with the same key has already been added."
On what key from what data references this message?
What can be the causes?
What can I do?

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

Re: Error while regenerating the model from database

Post by Shalex » Sat 29 Aug 2020 12:14

We recommend you to use Entity Developer (the Devart Entity Model item, *.edml) instead of EDM Designer (the ADO.NET Entity Data Model item, *.edmx) because it is adjusted for working with Oracle and has an advanced functionality: http://www.devart.com/entitydeveloper/ed-vs-edm.html. Additionally, Entity Developer adds registration of EF6 provider in app.config automatically and offers designer (Database First / Model First) for EF Core.

Entity Developer for Oracle is shipped with dotConnect for Oracle Professional Edition.

petersx
Posts: 3
Joined: Mon 24 Aug 2020 08:39

Re: Error while regenerating the model from database

Post by petersx » Mon 31 Aug 2020 07:14

Thank you for the reply.
I've read the paragraph about "Migration between ADO.NET Entity Data Model (*.edmx) and Devart Entity Model (*.edml)" at https://www.devart.com/dotconnect/oracl ... #migration and tried it. For me it is not clear, what means "change the extension of the model file to edml". Should I change the extension on file level or should I change it in the project file? Have I to change or to do anything else to complete the migration?

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

Re: Error while regenerating the model from database

Post by Shalex » Tue 01 Sep 2020 15:21

Please change the extension on file level. You can do that via Solution Explorer in your Visual Studio.

petersx
Posts: 3
Joined: Mon 24 Aug 2020 08:39

Re: Error while regenerating the model from database

Post by petersx » Fri 11 Sep 2020 09:16

I'have made this change from emdx to edml and also set the Build Action property of my model to "DevartEntityDeploy", and the Custom Tool to "DevartEfGenerator". I've added the new Entities with the Entity Developer.
I got the warning: "1 Model validation for Entity Framework 6 is not supported: the 'EntityFramework.dll' assembly is not available or .NET Framework 4.5 is not installed. C:\....\ConsoleApp1\ConsoleApp1\Console.edml ".
(Using the Oracle Version of EF I can use EF6 with .NET Framework 4.5, isn't it the same with DevArt?)
I can see the added Entities in the edml-File, but new compiling and starting the Custom Tool don't generate the appropriate classes.

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

Re: Error while regenerating the model from database

Post by Shalex » Fri 11 Sep 2020 16:55

petersx wrote: Fri 11 Sep 2020 09:16Model validation for Entity Framework 6 is not supported: the 'EntityFramework.dll' assembly is not available or .NET Framework 4.5 is not installed.
You should install the package EntityFramework into your Visual Studio project via Tools > Nuget Package Manager > Package Manager Console.

In the case of a standalone Entity Developer, you should copy EntityFramework.dll to the Entity Developer installation folder C:\Program Files (x86)\Devart\EntityDeveloper.
petersx wrote: Fri 11 Sep 2020 09:16I can see the added Entities in the edml-File, but new compiling and starting the Custom Tool don't generate the appropriate classes.
Send us a small test project for reproducing the issue via our contact form.

Post Reply