【问题标题】:ServiceStack.OrmLite get multiple result sets from a stored procedureServiceStack.OrmLite 从一个存储过程中获取多个结果集
【发布时间】:2014-04-17 21:50:01
【问题描述】:

我一直在使用 SqlList() 从 SP 接收结果集,它很方便。

var people = db.SqlList<Person>("EXEC GetRockstarsAged @age", new { "age", 42 });

但是如何使用这个 OrmLite 从单个 SP 获取多个结果集? 使用上述方法似乎只能检索第一个结果集。

【问题讨论】:

  • 我不确定 OrmLite 是否支持多个结果集。
  • OrmLite 支持使用multiple output parameters 调用 SP,但不支持多个结果集,尽管 OrmLite 确实在 ServiceStack.OrmLite.Dapper 命名空间中包含了 Dapper 的嵌入式版本。

标签: servicestack ormlite-servicestack


【解决方案1】:

不幸的是,ServiceStack.OrmLite 不支持多个结果集,除非与 Dapper 结合使用。 ServiceStack MARS (Multiple Active Result Sets) using ORMLite and Output Parameters

或者,您可以使用 .Net SqlCommand。 Return multiple recordsets from stored proc in C#

ServiceStack.OrmLite V4 注释:https://github.com/ServiceStack/ServiceStack.OrmLite

ServiceStack.OrmLite V3 注释:https://github.com/ServiceStack/ServiceStack.OrmLite/tree/v3

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-08
    • 2023-03-23
    • 1970-01-01
    • 2010-11-13
    • 1970-01-01
    相关资源
    最近更新 更多