Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top