質問

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