Use storedprocedure to fetch Master - Details records


#1

Hi
I’m Using Dreamfactory with .Net MVC, I’m wondering if it is possible to fetch master - detail records by stored procedure.
for instance I’m having a Customer table with fields

  1. CustomerID
    2.CustomerName
    Address table with field
  2. AddressID
  3. CustomerID
  4. Address
    One customer can have multiple address.
    Any help???

Thanks


#2

Multiple result sets are not supported.

You can achieve what you want by either splitting into 2 stored procedures or returning an entity that contains both customer and address data thus having duplicate customers in the result set. You can then group the results by customerID in C# if necessary.

Regards
Marko


#3

Is it possible to achieve the same by using related queries?


#4

Yes, of course. Have a look at the .NET SDK github repo, it has a AddressBookDemo that demonstrates related queries.

Regards
Marko