This documentation article
describes an approach to map multiple results sets – each result set is mapped to different method. In order to retrieve all result sets in single call you could define a partial class to our context and manually translate and combine all result sets. Find enclosed a short sample solution which demonstrates this approach by expanding the example provided in the documentation article
I would like to bring to your attention the following key points:
1. The class CarsAndOrdersMultipleResultSet (CarsAndOrdersMultipleResultSet.cs) represents the multiple result set to be returned by the stored procedure.
2. I defined partial class to our context – located in file SofiaCarsModel.partial.cs.
3. I defined a method (public CarsAndOrdersMultipleResultSet GetCarInfoAndOrders() – line 12) in the partial class to map the stored procedure that returns multiple result set.
4. All result sets were combined in an instance of CarsAndOrdersMultipleResultSet using the GetReaderForGetCarInfoAndOrders method (in file CarsAndOrdersMultipleResultSet.cs, lines 22 through 27).
(OADataReader reader =
Please note that the method GetReaderForGetCarInfoAndOrders is auto generated so you need to map the stored procedure before using this approach.
Do not hesitate to contact us if you have any further question.
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features
shipped with our latest release!