Oracle.EntityFrameworkCore

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
sbauder_sre
Posts: 8
Joined: Tue 10 Mar 2020 10:54

Oracle.EntityFrameworkCore

Post by sbauder_sre » Tue 10 Mar 2020 11:30

Hello,

Will Entity Developer work with Oracle.EntityFrameworkCore?

I've tried to create a new EF Core Model but the only Provider available is ".Net Framework Data Provider for SqlServer". Note that "Oracle Data Provider for .NET, Managed Driver" is available for a classic EF model.

If it isn't supported...
  1. Are there plans to support it in the future?
  2. Are there any configuration "hacks" to get the oracle provider added to the drop down?
  3. Is there something that I can directly edit in efml to support the provider. (I'm about to explore this option)
TIA

sbauder_sre
Posts: 8
Joined: Tue 10 Mar 2020 10:54

Re: Oracle.EntityFrameworkCore

Post by sbauder_sre » Tue 10 Mar 2020 12:52

Quick update...

I've figured out how to get the Oracle provider to appear in the Provider drop down for an EF Core model.
Editing "C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.exe.config" and adding the provider to the end of the EFCore Providers works.

Code: Select all

<EFCore core-assemblies-path="">
    <providers>
        <!-- ... out of the box providers are here ... -->
        <add name="Oracle.ManagedDataAccess.Client" />
    </providers>
</EFCore>      
Now, I'll just need to customize the template to support Oracle.EntityFrameworkCore.

So, the only question that remains is:
Will Entity Developer be updated to natively support Oracle.EntityFrameworkCore?

Thanks

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

Re: Oracle.EntityFrameworkCore

Post by Shalex » Wed 11 Mar 2020 13:04

You have implemented the correct fix. We will notify you when "C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.exe.config" includes <add name="Oracle.ManagedDataAccess.Client" /> by default.

sbauder_sre
Posts: 8
Joined: Tue 10 Mar 2020 10:54

Re: Oracle.EntityFrameworkCore

Post by sbauder_sre » Wed 11 Mar 2020 13:11

Thanks for the reply Shalex.

Are there also plans to update the default EF Core template to support Oracle.EntityFrameworkCore?

I had to manually update the switch statement in GenerateContextConfiguration to handle the provider and call "UseOracle".

Code: Select all

case ProvidersManager.OracleDPManagedInvariantName:
    methodName = "UseOracle";
break;

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

Re: Oracle.EntityFrameworkCore

Post by Shalex » Fri 13 Mar 2020 17:29

sbauder_sre wrote: Wed 11 Mar 2020 13:11Are there also plans to update the default EF Core template to support Oracle.EntityFrameworkCore?

I had to manually update the switch statement in GenerateContextConfiguration to handle the provider and call "UseOracle".

Code: Select all

case ProvidersManager.OracleDPManagedInvariantName:
    methodName = "UseOracle";
break;
This code has already been added to a predefined EF Core template in Entity Developer v6.6.936.

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

Re: Oracle.EntityFrameworkCore

Post by Shalex » Sat 04 Apr 2020 13:02

"ODP.NET, Managed Driver" is added to the list of available providers in EF Core Model: viewtopic.php?f=32&t=40473.

sbauder_sre
Posts: 8
Joined: Tue 10 Mar 2020 10:54

Re: Oracle.EntityFrameworkCore

Post by sbauder_sre » Fri 10 Apr 2020 14:24

Shalex, 6.7 seems to have resolved several problems I was experiencing with EF Core and Oracle.
Many thanks to the Entity Developer team for your hard work!

I have discovered a new issue with 6.7 and the VS 2019 integration. In a netstandard2.0 SDK style project many of the generated assets are now nested which is great! However, the edps file being nested under the efml is causing an error regenerating the code.
Custom tool error: The node 'XXXXXXXXXXXXXX.edps' cannot be renamed.
If I manually un-nest it by removing the <DependentUpon> element, save the project, close VS, and reopen everything I'm able to regenerate the code one time. After that the edps is re-nested under the efml and the error returns.

Feel free to move this to a new thread if necessary.

TIA

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

Re: Oracle.EntityFrameworkCore

Post by Shalex » Sat 11 Apr 2020 17:18

We cannot reproduce the issue in our environment. Please send us a test project for reproducing the error.

sbauder_sre
Posts: 8
Joined: Tue 10 Mar 2020 10:54

Re: Oracle.EntityFrameworkCore

Post by sbauder_sre » Mon 13 Apr 2020 12:57

I couldn't repro when creating a new model from scratch but it was consistently happening with an existing model created in 6.6.936.0. I recreated that model and the issue disappeared.

So it looks to be related to transitioning from 6.6.936.0 to 6.7.965.0. Perhaps something to do with updating the version numbers in the EDPS? Maybe one of the following:
  • <EntityDeveloper Version="6.6.936.0">
  • <ed:Property Name="EntitiesConfigurationOutput" Type="EntityDeveloper.TemplateEngine.OutputInfo, EntityDeveloper.Common, Version=6.6.936.0, Culture=neutral, PublicKeyToken=09af7300eec23701">
I'll consider this resolved for my situation and keep it in mind as a gotcha for future model updates.

If you do further testing and find the root cause please let me know. I'd be interested to know what it is.

Thanks!

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

Re: Oracle.EntityFrameworkCore

Post by Shalex » Tue 14 Apr 2020 13:30

If you encounter the same issue with future updates, please contact us again.

Post Reply