Search code examples
c#c#-4.0dynamicsimple.data

Mapping object hierarchies with Simple.Data


Has anyone figured out the best way to return an object hierarchy with a multiple record set stored procedure?

At the moment I am pulling out each of the record sets and mapping them individually into their types and then constructing the main type.

Example: an account object with roles and phone numbers, a stored proc returns 3 record sets, one with the account, one with the phone numbers for the account and the last with the accounts roles.

Is there a better way of combining the record set into one so that I can cast directly?


Solution

  • The next feature in line (for version 0.14, planned release in the next couple of weeks) is the With clause for queries, which will populate an object hierarchy. Having seen this question, I will think about how to expose enough of the implementation to make it usable in a stored procedure scenario.