Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devart web api call procedure with entity framework context

I have and web api and I use entity framework but for procedure I am calling procedure like code below

    public List<PDS_SPR_ATAMA> GetListAtama()
    {
        List<PDS_SPR_ATAMA> result = new List<PDS_SPR_ATAMA>();
        try
        {
            var param4 = new OracleParameter("PRC", OracleDbType.Cursor, ParameterDirection.Output);
            result = _db_dev.Database.SqlQuery<PDS_SPR_ATAMA>(
            "BEGIN BMS.PA_HR_PORTAL.PR_GET_SPR_ATAMALAR(:V_PRC); end;", param4).ToList();
            return result;
        }
        catch (Exception ex)
        {
            return result;
        }
    }

as library I use

using Devart.Data.Oracle;

I take error below

The Parameters collection only accepts Devart.Data.Oracle.OracleParameter type objects

How can I solve problem. Thanks in advance

like image 821
mr. pc_coder Avatar asked Nov 22 '25 07:11

mr. pc_coder


1 Answers

Please use Devart.Data.Oracle.OracleParameter instead of OracleParameter to make sure you are using OracleParameter from the Devart.Data.Oracle namespace.

like image 105
Devart Avatar answered Nov 24 '25 21:11

Devart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!