I've been using SqlList() to receive result sets from SPs and it is handy.

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

but how can I use this OrmLite to get multiple result sets from a single SP? Using the above approach only seems to retrieve the first result set.

有帮助吗?

解决方案

Unfortunately, ServiceStack.OrmLite does not support multiple result sets unless combined with Dapper. ServiceStack MARS (Multiple Active Result Sets) using ORMLite and Output Parameters

Alternatively, you can use the .Net SqlCommand. Return multiple recordsets from stored proc in C#

ServiceStack.OrmLite V4 notes: https://github.com/ServiceStack/ServiceStack.OrmLite

ServiceStack.OrmLite V3 notes: https://github.com/ServiceStack/ServiceStack.OrmLite/tree/v3

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top