Page 1 of 1

Error while regenerating the model from database

Posted: Tue 25 Aug 2020 07:33
by petersx
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?

Re: Error while regenerating the model from database

Posted: Sat 29 Aug 2020 12:14
by Shalex
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.

Re: Error while regenerating the model from database

Posted: Mon 31 Aug 2020 07:14
by petersx
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?

Re: Error while regenerating the model from database

Posted: Tue 01 Sep 2020 15:21
by Shalex
Please change the extension on file level. You can do that via Solution Explorer in your Visual Studio.

Re: Error while regenerating the model from database

Posted: Fri 11 Sep 2020 09:16
by petersx
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.

Re: Error while regenerating the model from database

Posted: Fri 11 Sep 2020 16:55
by Shalex
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.