Hello,
I am trying to use dotConnect for Oracle for Code First with existing Database (I am not planning to generate the DB layer from the code) My aim is to have pure c# classes mapped by fluent mapping to stored procedures for CUD operations. I already have fully working MSSQL solution and trying now to switch to dotConnect/ORACLE.
Here (http://forums.devart.com/viewtopic.php?t=28241) is information this should be possible, quote :
**************************
Now, with dotConnect for Oracle, you can use such new Entity Framework features as ... Code First Mapping to Insert/Update/Delete Stored Procedures ...
**************************
Well, this is usually done by calling the method MapToStoredProcedures in fluent mapping. But here I found it is not implemented?!! - http://forums.devart.com/viewtopic.php? ... res#p98859
So my question is : how do I map the stored procedures using CodeFirst if not with MapToStoredProcedures? Is there any documentation/example?
Thanks a lot!
Ales
Code First Mapping to Insert/Update/Delete Stored Procedures
Re: Code First Mapping to Insert/Update/Delete Stored Procedures
dotConnect for Oracle supports mapping of existing stored procedures to CUD operations in Code-First (via DbContext template): http://www.devart.com/dotconnect/oracle ... ngCUD.html.aldare666 wrote:Here (http://forums.devart.com/viewtopic.php?t=28241) is information this should be possible, quote :
**************************
Now, with dotConnect for Oracle, you can use such new Entity Framework features as ... Code First Mapping to Insert/Update/Delete Stored Procedures ...
**************************
Our provider doesn't support the functionality of creating stored procedures automatically (when stored procedures don't exist in the database before running the code).aldare666 wrote:Well, this is usually done by calling the method MapToStoredProcedures in fluent mapping. But here I found it is not implemented?!! - http://forums.devart.com/viewtopic.php? ... res#p98859
Re: Code First Mapping to Insert/Update/Delete Stored Procedures
Thank you for your answer and sorry for delayed reply.
I am not willing to create database from code, I just want to use code-first and use it for already existing database objects. When using this aproach, there is no need for any model in the solution and the objects are pure.
The only need is to create fluent mapping next to the objects. Reverse engineering of existing database to objects and mapping can be done by Entity Framework Power Tools.
Created mapping has to be able to say : use stored procedures for some or all CUD operations. This is done by MapToStoredProcedures call. Calling MapToStoredProcedures doesn't mean I will create database objects, although it might be possible, but that is not desired in my (and in almost any enterprise solution) case.
I have tried to do it this way, without any entity model and DBContext template. And to my surprise IT WORKS! Even for backloading of the newly created ID of C procedures returned by output cursor param. There seems to be some magic behind the scenes...
There are some other problems, I will create new forum threads for these.
I am not willing to create database from code, I just want to use code-first and use it for already existing database objects. When using this aproach, there is no need for any model in the solution and the objects are pure.
The only need is to create fluent mapping next to the objects. Reverse engineering of existing database to objects and mapping can be done by Entity Framework Power Tools.
Created mapping has to be able to say : use stored procedures for some or all CUD operations. This is done by MapToStoredProcedures call. Calling MapToStoredProcedures doesn't mean I will create database objects, although it might be possible, but that is not desired in my (and in almost any enterprise solution) case.
I have tried to do it this way, without any entity model and DBContext template. And to my surprise IT WORKS! Even for backloading of the newly created ID of C procedures returned by output cursor param. There seems to be some magic behind the scenes...
There are some other problems, I will create new forum threads for these.