Stored Procedure returns multiple tables but EF only creates single resultset with the only First datatable result

entity-framework-6 sql-server

Question

I have SP SPGetEmployeeDetails which returns two datatables like select * from employee select * from employeecompletedtraining. And I included the SP in the EF edmx. It creates result set which only returns the properties of first datatable i.e (select * from employee). But, I want both result sets using EF. We can easily achieve in using ADO connection which gives both results in dataset. I want to achieve using EF database first approach.

Any assistance will be highly appriciated.

1
1
5/25/2016 11:18:31 AM

Accepted Answer

I had a same requirement and was able to solve the by changing the function Import section in ef xml. Initially there is only one set of return type, you need to override the return type of the function import which will return two sets of record type.

Please go through the link below: http://www.codeproject.com/Articles/675933/Returning-Multiple-Result-Sets-from-an-Entity-Fram

1
5/25/2016 11:31:14 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow