EF Codefirst with ORACLE
Resolving stored procedures has not found a solution
So there was no way to use the most basic solution.
Using the ADO basic Access class provided by oracle.manageddataaccess, you do not need to refer to the third-party class library again.
Using Oracle.ManagedDataAccess.Client;
Public Object[] Executeproc (stringProcName,paramsdbparameter[] parms) {Mydbcontext DbContext= This. Getdbcontext (Accessmode.write); using(varconn =NewOracleConnection (dbContext.Database.Connection.ConnectionString)) {List<DbParameter> outparms = parms. Where (p = p.direction = = System.Data.ParameterDirection.Output | | p.direction = =System.Data.ParameterDirection.ReturnValue). ToList (); OracleCommand command=NewOracleCommand (procname); Command. Connection=Conn; Command.commandtype=CommandType.StoredProcedure; Command. Parameters.addrange (parms); Conn. Open (); Command. ExecuteNonQuery (); Command. Parameters.clear (); Command. Dispose (); Conn. Close (); Object[] values = Outparms.select (r =r.value). ToArray (); returnvalues; } }
Call
New baserepository (); var p3 = resp. Getparameterout ("count_row"4); Object [] o = resp. Executeproc ("PROC1", p3); var ss = P3. Value;
EF codefirst with ORACLE stored procedures