Closed michael-wolfenden closed 6 years ago
If you return the parent record in the first recordset, and children in a second recordset:
[Parent] SELECT 1 as Id
[Children] SELECT 1 as Id, 'a' as Value UNION...
Then you can tag the recordsets with:
[Sql(...)]
[Recordset(0, typeof(Record))]
[Recordset(1, typeof(String), IsChild=true, Into="Values")]
Task<Record> GetRecord();
I can't think of a simple way to do it without the parent record.
Do you have a specific use case you're trying to handle?
Thanks for the response
In my scenario all the data for the parent and child could be retrieved in a single query, rather than repeating the same filtered query twice (once for the parent data (just an Id in this case) and once for the child data))
Given the following:
Is there any way to make
GetRecord()
return a singleRecord
withId = 1
andValues = new List<string> { 'a', 'b', 'c'}