Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
cmisDevSupport
Posts: 4
Joined: Fri 11 Dec 2015 16:22

Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by cmisDevSupport » Fri 11 Dec 2015 18:15

Hi I have created an ASP.NET 5 / MVC 6 project to expose my Web API.

I am using Entity Framework 6 in a separate project in the same solution. How do I configure my ASP.NET 5 web project to use the dotConnect for Oracle driver since there is no longer a web.config file available.

I saw you offered a code based configuration option. So I tried to decorate my class that derives from DbContext class with your [DbConfigurationType(typeof(OracleEntityProviderServicesConfiguration))] attribute. Then configured the connection string in the config.json file. Finally I modified the Startup.ConfigureServices() method to get the connection string and add my DbContext service instance to the IoC container.

Example:
var connectionSettings = Configuration["Data:MyDbContext:ConnectionString"];
services.AddScoped((c) => new MyDbContext(connectionSettings));

cmisDevSupport
Posts: 4
Joined: Fri 11 Dec 2015 16:22

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by cmisDevSupport » Fri 11 Dec 2015 22:03

By the way I left off from the original post that the code based configuration approach is not working for me either.

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by Shalex » Thu 17 Dec 2015 14:27

cmisDevSupport wrote:I am using Entity Framework 6 in a separate project in the same solution. How do I configure my ASP.NET 5 web project to use the dotConnect for Oracle driver since there is no longer a web.config file available.
1. We did not test this approach but it should be possible to use Entity Framework 6 with ASP.NET 5:
https://github.com/aspnet/EntityFramework/issues/2336
http://stackoverflow.com/questions/2929 ... et-5-mvc-6
2. EF6 provider specific article: http://blog.devart.com/entity-framework ... force.html.

cmisDevSupport
Posts: 4
Joined: Fri 11 Dec 2015 16:22

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by cmisDevSupport » Fri 08 Jan 2016 15:45

Hi,

I have already read through the links that you have provided prior to submitting this post with no success. I have an immediate need. Is the forum the only available technical support option? Is there a way to talk to someone directly in technical support so I can resolve this issue or at least verify if dotConnect for Oracle driver supports ASP.NET 5/MVC 6 projects.

cmisDevSupport
Posts: 4
Joined: Fri 11 Dec 2015 16:22

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by cmisDevSupport » Fri 08 Jan 2016 15:52

I do have my ASP.NET project working with Entity Framework 6. That is not the problem. The issue is that I am unable to configure EF6 to use the devConnect Oracle driver. Where do I do that given the absence of the web.config files with the new ASP.NET 5/MVC6 project?

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by Shalex » Mon 11 Jan 2016 19:25

cmisDevSupport wrote:Where do I do that given the absence of the web.config files with the new ASP.NET 5/MVC6 project?
The http://blog.devart.com/entity-framework ... edExamples section includes the corresponding examples. If this doesn't help, please upload your test project, which works with System.Data.SqlClient, to some file exchange server. We will try to set it up for using Devart.Data.Oracle. If the test project doesn't exceed the 2 MB limit, you can upload it via our contact form.

aambikavally
Posts: 1
Joined: Fri 18 Aug 2017 19:52

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by aambikavally » Fri 18 Aug 2017 19:54

Does anybody have a solution to this? Why don't we have documentation or even a simple sample for this scenario?

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project

Post by Shalex » Mon 21 Aug 2017 13:12

Please refer to https://www.devart.com/dotconnect/oracl ... ntity.html. Is that what you need?

Post Reply