• <small id='452hq'></small><noframes id='452hq'>

      • <bdo id='452hq'></bdo><ul id='452hq'></ul>
    1. <legend id='452hq'><style id='452hq'><dir id='452hq'><q id='452hq'></q></dir></style></legend>
    2. <i id='452hq'><tr id='452hq'><dt id='452hq'><q id='452hq'><span id='452hq'><b id='452hq'><form id='452hq'><ins id='452hq'></ins><ul id='452hq'></ul><sub id='452hq'></sub></form><legend id='452hq'></legend><bdo id='452hq'><pre id='452hq'><center id='452hq'></center></pre></bdo></b><th id='452hq'></th></span></q></dt></tr></i><div id='452hq'><tfoot id='452hq'></tfoot><dl id='452hq'><fieldset id='452hq'></fieldset></dl></div>
      <tfoot id='452hq'></tfoot>

        实体框架核心 5 - 从单个存储过程返回两个 orac

        时间:2023-06-06
        <tfoot id='3pbAe'></tfoot>
        • <small id='3pbAe'></small><noframes id='3pbAe'>

          <legend id='3pbAe'><style id='3pbAe'><dir id='3pbAe'><q id='3pbAe'></q></dir></style></legend>

                <bdo id='3pbAe'></bdo><ul id='3pbAe'></ul>

                    <tbody id='3pbAe'></tbody>
                  <i id='3pbAe'><tr id='3pbAe'><dt id='3pbAe'><q id='3pbAe'><span id='3pbAe'><b id='3pbAe'><form id='3pbAe'><ins id='3pbAe'></ins><ul id='3pbAe'></ul><sub id='3pbAe'></sub></form><legend id='3pbAe'></legend><bdo id='3pbAe'><pre id='3pbAe'><center id='3pbAe'></center></pre></bdo></b><th id='3pbAe'></th></span></q></dt></tr></i><div id='3pbAe'><tfoot id='3pbAe'></tfoot><dl id='3pbAe'><fieldset id='3pbAe'></fieldset></dl></div>
                  本文介绍了实体框架核心 5 - 从单个存储过程返回两个 oracle 游标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在开发一个调用 oracle 存储过程的 API - 我无法触及它 - 并返回两个 refcursors.问题是,在我的代码中,只有从 sp 返回的第一个游标 beign 被映射,而另一个游标则是 InvalidOperationException.

                  I'm working on an API that calls an oracle stored procedure -I can't touch it- and returns two refcursors. The problem is that in my code, only the first cursor beign returned from the sp gets mapped, while the other one trows an InvalidOperationException.

                  var sql = "BEGIN CCO_PKG_WHITDRAWREQUEST.OBT_OPCION_RET_DES_PRC(:pi_num_seguro_social , :pi_num_resolucion, :po_cur_valida_res, :po_cur_opciones); END;";
                  
                              var parameters = new OracleParameter[]
                              {
                                  new OracleParameter("pi_num_seguro_social", request.NSS),
                                  new OracleParameter("pi_num_resolucion", request.NumResolucion),
                                  new OracleParameter("po_cur_valida_res", OracleDbType.RefCursor, ParameterDirection.Output),
                                  new OracleParameter("po_cur_opciones", OracleDbType.RefCursor, ParameterDirection.Output)
                              };
                              
                              //This one gets mapped without problems.
                              var validaResCursor = await _context.CursorValidaRes.FromSqlRaw(sql, parameters).ToListAsync();
                              
                              //This one throws the exception.
                              var opcionesCursor = await _context.CursorOpciones.FromSqlRaw(sql, parameters).ToListAsync();
                  
                              var result = (opcionesCursor, validaResCursor);
                  

                  被映射的游标类

                      [Keyless]
                      public class ValidaResCursor
                      {
                          public string EsCVEValido { get; set; }
                          public string Opcion { get; set; }
                          public string Descripcion { get; set; }
                          public double SaldoA { get; set; }
                          public double SaldoB { get; set; }
                          public string Vigencia { get; set; }
                      }
                  }
                  

                  没有的游标类

                      [Keyless]
                      public class OpcionesCursor
                      {
                          public string cv { get; set; }
                          public string tipo { get; set; }
                          public string descripcion { get; set; }
                          public double monto { get; set; }
                          public double salario_bc { get; set; }
                      }
                  

                  执行

                  第一个游标被正确映射(它只有 1 行).

                  第二个光标抛出错误.

                  这是我第一次在 dotnet 环境中使用 oracle,但我正在遵循 oracle 的官方指南,(参见.https://github.com/oracle/dotnet-db-samples/blob/master/samples/dotnet-core/ef-core/stored-procedure/return-ref-cursor.cs),正如您所见,显然它仅适用于仅返回一个游标的 sp.有任何想法吗?任何帮助将不胜感激.

                  This is the first time I'm working with oracle in a dotnet enviroment, but I'm following the oficial guide from oracle, (see. https://github.com/oracle/dotnet-db-samples/blob/master/samples/dotnet-core/ef-core/stored-procedure/return-ref-cursor.cs) and as you can see, aparently it only works with sp's that returns only one cursor. Any ideas? Any help will be appreciated.

                  推荐答案

                  目前 EF Core 不支持:https://github.com/dotnet/efcore/issues/8127 查看链接以找到此问题的替代方案.

                  Currently this is not supported by EF Core: https://github.com/dotnet/efcore/issues/8127 take a look at the link to find alternatives to this problem.

                  这篇关于实体框架核心 5 - 从单个存储过程返回两个 oracle 游标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:为什么我需要手动打开这个 .NET Core 数据库连接, 下一篇:ADO.NET - 使用应用程序提供的登录名和密码通过

                  相关文章

                  最新文章

                  <i id='5eixE'><tr id='5eixE'><dt id='5eixE'><q id='5eixE'><span id='5eixE'><b id='5eixE'><form id='5eixE'><ins id='5eixE'></ins><ul id='5eixE'></ul><sub id='5eixE'></sub></form><legend id='5eixE'></legend><bdo id='5eixE'><pre id='5eixE'><center id='5eixE'></center></pre></bdo></b><th id='5eixE'></th></span></q></dt></tr></i><div id='5eixE'><tfoot id='5eixE'></tfoot><dl id='5eixE'><fieldset id='5eixE'></fieldset></dl></div>

                  <tfoot id='5eixE'></tfoot>
                • <small id='5eixE'></small><noframes id='5eixE'>

                    • <bdo id='5eixE'></bdo><ul id='5eixE'></ul>

                    <legend id='5eixE'><style id='5eixE'><dir id='5eixE'><q id='5eixE'></q></dir></style></legend>