{"action":"created","issue":{"url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81","repository_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator","labels_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81/comments","events_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81/events","html_url":"https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81","id":169475111,"number":81,"title":"Stored procedure with multiple optional result sets returns incorrect entities","user":{"login":"kesh00","id":4585498,"avatar_url":"https://avatars.githubusercontent.com/u/4585498?v=3","gravatar_id":"","url":"https://api.github.com/users/kesh00","html_url":"https://github.com/kesh00","followers_url":"https://api.github.com/users/kesh00/followers","following_url":"https://api.github.com/users/kesh00/following{/other_user}","gists_url":"https://api.github.com/users/kesh00/gists{/gist_id}","starred_url":"https://api.github.com/users/kesh00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kesh00/subscriptions","organizations_url":"https://api.github.com/users/kesh00/orgs","repos_url":"https://api.github.com/users/kesh00/repos","events_url":"https://api.github.com/users/kesh00/events{/privacy}","received_events_url":"https://api.github.com/users/kesh00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-04T21:13:37Z","updated_at":"2016-08-05T09:52:27Z","closed_at":"2016-08-05T09:52:26Z","body":"Stored procedures can return result sets in any order or combination, and does not need to return all possible result sets for each call. Unfortunately, the code generated relies on all result sets being returned and all being returned in the same order.\r\n\r\n```\r\nprocResultData.ResultSet1 = objectContext.Translate<ProcReturnModel.ResultSetModel1>(reader).ToList();\r\nreader.NextResult();\r\n\r\nprocResultData.ResultSet2 = objectContext.Translate<ProcReturnModel.ResultSetModel2>(reader).ToList();\r\nreader.NextResult();\r\n\r\nprocResultData.ResultSet3 = objectContext.Translate<ProcReturnModel.ResultSetModel3>(reader).ToList();\r\nreader.NextResult();\r\n\r\nprocResultData.ResultSet4 = objectContext.Translate<ProcReturnModel.ResultSetModel4>(reader).ToList();\r\nreader.NextResult();\r\n```\r\n\r\nFor example, in the above generated code, if ResultSet3 is not returned by the stored procedure on a particular call, the data from ResultSet4 will be the \"NextResult.\" The code will attempt to translate the result set to ProcReturnModel.ResultSetModel3 instead of ProcReturnModel.ResultSetModel4, even though the models may be completely different."},"comment":{"url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/comments/237810440","html_url":"https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81#issuecomment-237810440","issue_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/81","id":237810440,"user":{"login":"sjh37","id":4190514,"avatar_url":"https://avatars.githubusercontent.com/u/4190514?v=3","gravatar_id":"","url":"https://api.github.com/users/sjh37","html_url":"https://github.com/sjh37","followers_url":"https://api.github.com/users/sjh37/followers","following_url":"https://api.github.com/users/sjh37/following{/other_user}","gists_url":"https://api.github.com/users/sjh37/gists{/gist_id}","starred_url":"https://api.github.com/users/sjh37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjh37/subscriptions","organizations_url":"https://api.github.com/users/sjh37/orgs","repos_url":"https://api.github.com/users/sjh37/repos","events_url":"https://api.github.com/users/sjh37/events{/privacy}","received_events_url":"https://api.github.com/users/sjh37/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T09:52:26Z","updated_at":"2016-08-05T09:52:26Z","body":"I have test this, and it is working fine.\r\nI created a stored procedure to return 3 result sets.\r\n\r\n- First set returns 1 row\r\n- Second, returns nothing\r\n- Third returns 3 rows\r\n\r\n![2016-08-05_10-51-01](https://cloud.githubusercontent.com/assets/4190514/17433100/9f8fa282-5afa-11e6-8b12-1f4fd8d78878.png)\r\n"}}
{"actor":{"display_login":"sjh37"}}