BLToolkit: multiple result sets?

I did not find a way to get two lists of objects from SP with two select operations. Is this possible with BLToolkit or can only hierarchical data be obtained in this way?

I am trying to replace a dataset containing two unrelated tables.

+4
source share
1 answer

Turns out it was very simple. :)

Here you return some unrelated result sets using BLToolkit.

List<Apple> apples = new List<Apple>(); List<Orange> oranges = new List<Orange>(); MapResultSet[] sets = new MapResultSet[2]; sets[0] = new MapResultSet(typeof(Apple), apples); sets[1] = new MapResultSet(typeof(Orange), oranges); //Make sure both lists are added //Skip adding relations using (DbManager db = new DbManager()) { db .SetSpCommand("usp_Fruit_GetBySomething", db.Parameter("someParam", someParam)) .ExecuteResultSet(sets); } foreach(Apple apple in apples) { profit(apple); } foreach(Orange orange in oranges) { profit(orange); } 
+4
source

Source: https://habr.com/ru/post/1338170/


All Articles