{"action":"opened","issue":{"url":"https://api.github.com/repos/HighwayFramework/Highway.Data/issues/90","labels_url":"https://api.github.com/repos/HighwayFramework/Highway.Data/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/HighwayFramework/Highway.Data/issues/90/comments","events_url":"https://api.github.com/repos/HighwayFramework/Highway.Data/issues/90/events","html_url":"https://github.com/HighwayFramework/Highway.Data/issues/90","id":116391711,"number":90,"title":"Handling Output Parameters From A Stored Procedure","user":{"login":"daudirsch","id":5702392,"avatar_url":"https://avatars.githubusercontent.com/u/5702392?v=3","gravatar_id":"","url":"https://api.github.com/users/daudirsch","html_url":"https://github.com/daudirsch","followers_url":"https://api.github.com/users/daudirsch/followers","following_url":"https://api.github.com/users/daudirsch/following{/other_user}","gists_url":"https://api.github.com/users/daudirsch/gists{/gist_id}","starred_url":"https://api.github.com/users/daudirsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daudirsch/subscriptions","organizations_url":"https://api.github.com/users/daudirsch/orgs","repos_url":"https://api.github.com/users/daudirsch/repos","events_url":"https://api.github.com/users/daudirsch/events{/privacy}","received_events_url":"https://api.github.com/users/daudirsch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-11T18:22:35Z","updated_at":"2015-11-11T18:22:35Z","closed_at":null,"body":"I have an older stored proc that returns a set of records as well as an output value.  Is it possible to call a stored proc with an output parameter and return it back to the UI/Biz layer using HwyFwk?\r\n\r\nHere is my query:\r\n\r\n    public class GetLog : AdvancedQuery<GetLogResult>\r\n    {\r\n        public GetLog(int currentPage,int pageSize)\r\n        {\r\n            ContextQuery = db =>\r\n            {\r\n                var sql = string.Format(\"execute GetLog\");\r\n                SqlParameter outputIdParam = new SqlParameter(\"@ReturnValue\", SqlDbType.Int)\r\n                {\r\n                    Direction = ParameterDirection.Output\r\n                };\r\n                var results = db.Database.SqlQuery<GetActivityLogResult>(sql,\r\n                                                                  new SqlParameter(\"@CurrentPage\",currentPage),\r\n                                                                  new SqlParameter(\"@PageSize\",currentPage),\r\n                                                                  outputIdParam\r\n                                                                  ).AsQueryable();\r\n\r\n                //How can I return this and my recordset back to the UI/Biz layer?\r\n                //TotalRows = (int)outputIdParam.Value;\r\n                return results;\r\n            };\r\n        }\r\n    }\r\n"}}