tags:

views:

19

answers:

0

My goal is to call a stored procedure that returns one recordset with columns from multiple tables, and have that recordset populate all related objects.

This works perfectly using Linq-2-Sql (or EF) with DeferredLoadingEnabled=false and the LoadWith() option. At some point MS is taking the result set and matching the fields to the related properties of all objects.

I know this subject has been beaten to death, and from my research it's just not natively possible when stored procedures are returning the recordset.

However, is there any way to tap into whatever process MS is using to convert a recordset into multiple objects?

Ideally, it would just be a DataReader extension method that's called ConvertTo() and it just starts matching columns to properties and embedded object's properties.

Thanks!