DRCP Entity Framework

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
kklauder
Posts: 2
Joined: Tue 08 Apr 2014 12:59

DRCP Entity Framework

Post by kklauder » Fri 12 Dec 2014 15:33

Hello,

I have a Project in Production that uses ASP.NET WEB API v2 with ODATA. I am using Entity Framework 5 with ODP.NET using Database First models.

Can I use your dotConnect for Oracle and Not have to redesign my models and stored functions?

Also I Change my connection string values at runtime using partial classes of the DBContext. Can this be done using the dotConnect for oracle? I want to change the connection class at runtime for using DRCP.

If this is all possible, It this just done through the webconfig? Do you have an example?
Thanks

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

Re: DRCP Entity Framework

Post by Shalex » Mon 15 Dec 2014 11:41

kklauder wrote:I am using Entity Framework 5 with ODP.NET using Database First models.
Can I use your dotConnect for Oracle and Not have to redesign my models and stored functions?
You can migrate your ODP.NET EF model to Devart.Data.Oracle in the following way:
a) install Entity Developer Professional Trial for migrating (you can uninstall it after the migration is done, it is needed because it supports ODP.NET) and dotConnect for Oracle Professional (Trial or licensed version)
b) open your existing *.edmx model in Entity Developer
c) create the *.edml model (Devart Entity Model) and add all your tables from SQL Server in the model
d) add the DbContext (http://blog.devart.com/entity-developer ... plate.html) template via the context menu of the Model Explorer > Templates node, also set its "Fluent Mapping = True" property
e) select designer surface and set the Metadata Artifact Processing property of EntityContextModel to Do Not Generate Mapping Files
f) save the model and generate code
g) that's all. Now you can uninstall Entity Developer as a separate tool. dotConnect for Oracle Professional includes its own Entity Developer (it can be used only with Devart.Data.Oracle)
kklauder wrote:Also I Change my connection string values at runtime using partial classes of the DBContext. Can this be done using the dotConnect for oracle?
You can do this in the same way like you did it with ODP.NET:

Code: Select all

var conn = (((IObjectContextAdapter)MyDbContext).ObjectContext.Connection as System.Data.EntityClient.EntityConnection).StoreConnection;
kklauder wrote:I want to change the connection class at runtime for using DRCP.
dotConnect for Oracle includes the Connection Class connection string parameter for enabling Oracle's Database Resident Connection Pooling (DRCP). You need to set also OCI Session Pooling = true for using DRCP.

Post Reply