سؤال

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