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开发者_JAVA技巧 even from code done easily?
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.
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
精彩评论