{"action":"created","issue":{"url":"https://api.github.com/repos/jbogard/MediatR/issues/71","repository_url":"https://api.github.com/repos/jbogard/MediatR","labels_url":"https://api.github.com/repos/jbogard/MediatR/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/jbogard/MediatR/issues/71/comments","events_url":"https://api.github.com/repos/jbogard/MediatR/issues/71/events","html_url":"https://github.com/jbogard/MediatR/issues/71","id":142047183,"number":71,"title":"Per request scopes in e.g. Autofac will eat resources","user":{"login":"danielwertheim","id":196044,"avatar_url":"https://avatars.githubusercontent.com/u/196044?v=3","gravatar_id":"","url":"https://api.github.com/users/danielwertheim","html_url":"https://github.com/danielwertheim","followers_url":"https://api.github.com/users/danielwertheim/followers","following_url":"https://api.github.com/users/danielwertheim/following{/other_user}","gists_url":"https://api.github.com/users/danielwertheim/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwertheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwertheim/subscriptions","organizations_url":"https://api.github.com/users/danielwertheim/orgs","repos_url":"https://api.github.com/users/danielwertheim/repos","events_url":"https://api.github.com/users/danielwertheim/events{/privacy}","received_events_url":"https://api.github.com/users/danielwertheim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-03-19T09:45:23Z","updated_at":"2016-04-01T23:39:03Z","closed_at":null,"body":"Sample here: https://gist.github.com/danielwertheim/887868c17ab8cd67be44\r\n\r\nKind of followed your sample code... Probably have missed something. And yes, I know I could inject `Func<SomeDependency>` instead and have the handler resolve and dispose....\r\n\r\nBut how do I acomplish per-routed message scoped handlers? If not possible with MediatR, perhaps state that clearly in the sample?"},"comment":{"url":"https://api.github.com/repos/jbogard/MediatR/issues/comments/204608382","html_url":"https://github.com/jbogard/MediatR/issues/71#issuecomment-204608382","issue_url":"https://api.github.com/repos/jbogard/MediatR/issues/71","id":204608382,"user":{"login":"kappy","id":381718,"avatar_url":"https://avatars.githubusercontent.com/u/381718?v=3","gravatar_id":"","url":"https://api.github.com/users/kappy","html_url":"https://github.com/kappy","followers_url":"https://api.github.com/users/kappy/followers","following_url":"https://api.github.com/users/kappy/following{/other_user}","gists_url":"https://api.github.com/users/kappy/gists{/gist_id}","starred_url":"https://api.github.com/users/kappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kappy/subscriptions","organizations_url":"https://api.github.com/users/kappy/orgs","repos_url":"https://api.github.com/users/kappy/repos","events_url":"https://api.github.com/users/kappy/events{/privacy}","received_events_url":"https://api.github.com/users/kappy/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T23:39:02Z","updated_at":"2016-04-01T23:39:02Z","body":"@leddt aren't the factory method just delegates? So all you're doing is querying the Ioc for the instances of the type, based on the scope it currently is.\r\nEven if the Mediator is configured as Singleton, it could resolve the handler instances based on the current scope."}}