Last Updated: February 25, 2016
·
1.885K
· Scott Guymer

Enitity Framework Stored Procedures with Multiple Result Sets

I recently had the need to call a stored procedure that returned multiple result sets from within EF and have EF bind the results to a strongly typed collection.

https://gist.github.com/ScottGuymer/5663359

This works really well and EF does all the heavy lifting of mapping the result sets to the objects.

The only issue I ran into was having to add the paramater name for the stored procedure in the CommandText like so

cmd.CommandText = "[dbo].[storedProcedureName] @Query"

Have a fresh tip? Share with Coderwall community!

Post
Post a tip