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

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

Postby 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

Postby 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.
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

Postby 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/29296073/how-to-use-entity-framework-6-x-in-asp-net-5-mvc-6
2. EF6 provider specific article: http://blog.devart.com/entity-framework-6-support-for-oracle-mysql-postgresql-sqlite-and-salesforce.html.
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44

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

Postby 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

Postby 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?
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

Postby 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-6-support-for-oracle-mysql-postgresql-sqlite-and-salesforce.html#CodeBasedExamples 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.
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle