My work recently starting using PetaPoco
and although fantastic I missed the feature from Dapper
which allowed multiple result grids from a single query to be processed into pocos.
As a result I wrote my own implementation for PetaPoco
- shown below - but has anyone written their own and care to share it?
I thought there might be others out there who have missed this feature.
Info
I used the Dapper source as inspiration to implement this feature, so any similarities are due to that.
This makes changes directly to the PetaPoco.cs file, which you probably shouldn't do judging from the comment at the start!
This code has been tested but not thoroughly, please exercise appropriate caution!
Usage
Changes - PetaPoco (Core) v.5.0.1
Inside the class PetaPoco.Database add:
At the root level (namespace: PetaPoco) add:
I have submitted this change to the PetaPoco v5 branch but thought people might get some benefit if I posted it here.
PetaPoco already supports multiple result sets.