Can Entity Framework handle several result sets from a stored method (each from connected tables)?

entity-framework linq-to-entities linq-to-sql

Question

In Linq to SQL, I can't find an easy way to deal with multiple result sets returned by a stored procedure where each result set is from table joins. Each result set does not map directly to a table. (can't change this behavior). For now, it seems using a DataSet is a lot simpler.

Can the current Entity Framework or the upcoming one, 4.0, deal with these kind of scenarios straight from the designer? Or even from code done easily?

1
5
10/16/2009 8:23:17 PM

Accepted Answer

This isn't supported out of the box in the new EF.

But there is a project on CodeGallery called EF Extensions that shows how to do this easily enough.

Hope this helps

Alex

3
10/16/2009 9:40:26 PM

Popular Answer

This is an old question, but time marches on. I just wanted to add that as of the June 2011 CTP release EF now supports multiple result sets from a stored proc:

http://blogs.msdn.com/b/adonet/archive/2011/06/30/announcing-the-microsoft-entity-framework-june-2011-ctp.aspx

http://blogs.msdn.com/b/adonet/archive/2011/06/30/walkthrough-multiple-result-sets-from-stored-procedure.aspx

Disclaimer: The feature isn't part of EF 4.1, 4.2 or 4.3. Apparently it is going to be packaged with .NET 4.5 & EF 5.0.



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