Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
-
- Posts: 4
- Joined: Fri 11 Dec 2015 16:22
Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
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));
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));
-
- Posts: 4
- Joined: Fri 11 Dec 2015 16:22
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
By the way I left off from the original post that the code based configuration approach is not working for me either.
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
1. We did not test this approach but it should be possible to use Entity Framework 6 with ASP.NET 5: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.
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.
-
- Posts: 4
- Joined: Fri 11 Dec 2015 16:22
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
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.
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.
-
- Posts: 4
- Joined: Fri 11 Dec 2015 16:22
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
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?
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web 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.cmisDevSupport wrote:Where do I do that given the absence of the web.config files with the new ASP.NET 5/MVC6 project?
-
- Posts: 1
- Joined: Fri 18 Aug 2017 19:52
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
Does anybody have a solution to this? Why don't we have documentation or even a simple sample for this scenario?
Re: Configuring EF 6 to use dotConnect for Oracle in ASP.NET 5 web project
Please refer to https://www.devart.com/dotconnect/oracl ... ntity.html. Is that what you need?