{"action":"created","issue":{"url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/617","repository_url":"https://api.github.com/repos/simpleinjector/SimpleInjector","labels_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/617/labels{/name}","comments_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/617/comments","events_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/617/events","html_url":"https://github.com/simpleinjector/SimpleInjector/issues/617","id":363541413,"node_id":"MDU6SXNzdWUzNjM1NDE0MTM=","number":617,"title":"Resolve service depending on a created scope","user":{"login":"Dundercover","id":1681435,"node_id":"MDQ6VXNlcjE2ODE0MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/1681435?v=4","gravatar_id":"","url":"https://api.github.com/users/Dundercover","html_url":"https://github.com/Dundercover","followers_url":"https://api.github.com/users/Dundercover/followers","following_url":"https://api.github.com/users/Dundercover/following{/other_user}","gists_url":"https://api.github.com/users/Dundercover/gists{/gist_id}","starred_url":"https://api.github.com/users/Dundercover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dundercover/subscriptions","organizations_url":"https://api.github.com/users/Dundercover/orgs","repos_url":"https://api.github.com/users/Dundercover/repos","events_url":"https://api.github.com/users/Dundercover/events{/privacy}","received_events_url":"https://api.github.com/users/Dundercover/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-25T11:56:53Z","updated_at":"2018-09-25T16:15:52Z","closed_at":null,"author_association":"NONE","body":"I have IoC set up in a ASP.NET MVC web app using SimpleInjector. I'm also using another tool called [hangfire](https://www.hangfire.io) inside the web app which is using the same container but separate async scoped lifestyle when executing (apart from the usual web request lifestyle). \r\n\r\nI want some logic (which is inside a service of a service etc) to differ depending on if it is being run in a web request or inside a hangfire worker. The tricky part is that the logic is also dependent on some information from hangfire (when in the async scope) that is only available during scope creation. I'm using [this piece of code](https://github.com/devmondo/HangFire.SimpleInjector/blob/master/src/HangFire.SimpleInjector/SimpleInjectorJobActivator.cs) to begin an async scope when activating a hangfire job.\r\n\r\nIs there any way I can solve this? \r\n\r\nI appreciate any help I can get!"},"comment":{"url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/comments/424408041","html_url":"https://github.com/simpleinjector/SimpleInjector/issues/617#issuecomment-424408041","issue_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/617","id":424408041,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDQwODA0MQ==","user":{"login":"dotnetjunkie","id":1506621,"node_id":"MDQ6VXNlcjE1MDY2MjE=","avatar_url":"https://avatars1.githubusercontent.com/u/1506621?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnetjunkie","html_url":"https://github.com/dotnetjunkie","followers_url":"https://api.github.com/users/dotnetjunkie/followers","following_url":"https://api.github.com/users/dotnetjunkie/following{/other_user}","gists_url":"https://api.github.com/users/dotnetjunkie/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnetjunkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnetjunkie/subscriptions","organizations_url":"https://api.github.com/users/dotnetjunkie/orgs","repos_url":"https://api.github.com/users/dotnetjunkie/repos","events_url":"https://api.github.com/users/dotnetjunkie/events{/privacy}","received_events_url":"https://api.github.com/users/dotnetjunkie/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T16:15:52Z","updated_at":"2018-09-25T16:15:52Z","author_association":"COLLABORATOR","body":"Csn you please share some information (preferably code) that demonstrates the logic you wish to run and how it depends on Hangfire?"}}
{"actor":{"display_login":"dotnetjunkie"}}