{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1864","repository_url":"https://api.github.com/repos/aspnet/EntityFramework","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1864/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1864/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1864/events","html_url":"https://github.com/aspnet/EntityFramework/issues/1864","id":63119604,"number":1864,"title":"Raw store access: Support execution of SQL that returns results but is not composable on the store, e.g. stored procedures","user":{"login":"divega","id":1253414,"avatar_url":"https://avatars.githubusercontent.com/u/1253414?v=3","gravatar_id":"","url":"https://api.github.com/users/divega","html_url":"https://github.com/divega","followers_url":"https://api.github.com/users/divega/followers","following_url":"https://api.github.com/users/divega/following{/other_user}","gists_url":"https://api.github.com/users/divega/gists{/gist_id}","starred_url":"https://api.github.com/users/divega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divega/subscriptions","organizations_url":"https://api.github.com/users/divega/orgs","repos_url":"https://api.github.com/users/divega/repos","events_url":"https://api.github.com/users/divega/events{/privacy}","received_events_url":"https://api.github.com/users/divega/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/2%20-%20Done","name":"2 - Done","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/pri0","name":"pri0","color":"e11d21"},{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/task","name":"task","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":{"login":"mikary","id":6787717,"avatar_url":"https://avatars.githubusercontent.com/u/6787717?v=3","gravatar_id":"","url":"https://api.github.com/users/mikary","html_url":"https://github.com/mikary","followers_url":"https://api.github.com/users/mikary/followers","following_url":"https://api.github.com/users/mikary/following{/other_user}","gists_url":"https://api.github.com/users/mikary/gists{/gist_id}","starred_url":"https://api.github.com/users/mikary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikary/subscriptions","organizations_url":"https://api.github.com/users/mikary/orgs","repos_url":"https://api.github.com/users/mikary/repos","events_url":"https://api.github.com/users/mikary/events{/privacy}","received_events_url":"https://api.github.com/users/mikary/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/13","html_url":"https://github.com/aspnet/EntityFramework/milestones/1.0.0-beta5","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/13/labels","id":1031326,"number":13,"title":"1.0.0-beta5","description":"","creator":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":42,"state":"closed","created_at":"2015-03-20T16:38:28Z","updated_at":"2016-01-28T04:34:23Z","due_on":"2015-05-27T07:00:00Z","closed_at":"2015-06-30T23:16:59Z"},"comments":14,"created_at":"2015-03-19T23:57:37Z","updated_at":"2016-04-15T10:04:53Z","closed_at":"2015-06-19T17:11:21Z","body":"We should provide a simple mechanism to execute queries/commands such as regular stored procedures that contain a SELECT statement. What `FromSql()` does won't work for those because you cannot used them as sub queries. \r\n\r\nA few things we could use:\r\n\r\n1. Provide an API akin `FromSql()` but switch composition to in-memory if subsequent LINQ operators are applied. Same warning and kill switch for query evaluation we have talked about having for other queries would apply to these.\r\n2. Provide a completely separate API pattern that is meant for non-composable results and even not return `IEnumerable<T>` but a new type that implements `GetEnumerator()` and `AsEnumerable()`\r\n3. Stick the stored procedure results into a table-valued variable and then keep composing as normal. This would move processing to the server and make composition more seamless but would most likely not make it any more efficient than option (1).\r\n4. Recognize the token “EXEC” in `FromSql()` (which is pretty standard although no longer required) for SQL Server as an indication that what follows is a non-composable stored procedure and that needs to go through a different execution mode (e.g. the one described in (1) or the one described in (3)). \r\n\r\n<!---\r\n@huboard:{\"order\":2352.0,\"milestone_order\":1864,\"custom_state\":\"\"}\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments/210398592","html_url":"https://github.com/aspnet/EntityFramework/issues/1864#issuecomment-210398592","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1864","id":210398592,"user":{"login":"tiwariarvin","id":4313475,"avatar_url":"https://avatars.githubusercontent.com/u/4313475?v=3","gravatar_id":"","url":"https://api.github.com/users/tiwariarvin","html_url":"https://github.com/tiwariarvin","followers_url":"https://api.github.com/users/tiwariarvin/followers","following_url":"https://api.github.com/users/tiwariarvin/following{/other_user}","gists_url":"https://api.github.com/users/tiwariarvin/gists{/gist_id}","starred_url":"https://api.github.com/users/tiwariarvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiwariarvin/subscriptions","organizations_url":"https://api.github.com/users/tiwariarvin/orgs","repos_url":"https://api.github.com/users/tiwariarvin/repos","events_url":"https://api.github.com/users/tiwariarvin/events{/privacy}","received_events_url":"https://api.github.com/users/tiwariarvin/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T10:04:53Z","updated_at":"2016-04-15T10:04:53Z","body":"Hi Rowanmiller - Did you had a chance to check this? I am curious because I see some serous performance gains."}}