{"action":"created","issue":{"url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/237","repository_url":"https://api.github.com/repos/simpleinjector/SimpleInjector","labels_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/237/comments","events_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/237/events","html_url":"https://github.com/simpleinjector/SimpleInjector/issues/237","id":155973164,"number":237,"title":"RegisterConditional with custom InjectionConsumerInfo","user":{"login":"DaEkstrim","id":18722053,"avatar_url":"https://avatars.githubusercontent.com/u/18722053?v=3","gravatar_id":"","url":"https://api.github.com/users/DaEkstrim","html_url":"https://github.com/DaEkstrim","followers_url":"https://api.github.com/users/DaEkstrim/followers","following_url":"https://api.github.com/users/DaEkstrim/following{/other_user}","gists_url":"https://api.github.com/users/DaEkstrim/gists{/gist_id}","starred_url":"https://api.github.com/users/DaEkstrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaEkstrim/subscriptions","organizations_url":"https://api.github.com/users/DaEkstrim/orgs","repos_url":"https://api.github.com/users/DaEkstrim/repos","events_url":"https://api.github.com/users/DaEkstrim/events{/privacy}","received_events_url":"https://api.github.com/users/DaEkstrim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-20T14:17:10Z","updated_at":"2016-05-23T13:48:47Z","closed_at":null,"body":"We have a multi tenancy application which is using Dependency Injection to provide services depending on some attribute information the implementation is decorated with.\r\n\r\nI was taking a look at SimpleInjector and I found that it supports RegisterConditional, where one of the overloads accepts `Func<TypeFactoryContext, Type>`. While taking a look at `TypeFactoryContext`, I came across the Consumer which is of type `InjectionConsumerInfo `which is a public unsealed class.\r\n\r\nMy question is: Is it possible to provide the conditional predicate with our custom class that inherits from `InjectionConsumerInfo `that provides a little more information (related to the multi tenancy in question such as ClientId)? If yes, how can this be achieved?"},"comment":{"url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/comments/220985323","html_url":"https://github.com/simpleinjector/SimpleInjector/issues/237#issuecomment-220985323","issue_url":"https://api.github.com/repos/simpleinjector/SimpleInjector/issues/237","id":220985323,"user":{"login":"DaEkstrim","id":18722053,"avatar_url":"https://avatars.githubusercontent.com/u/18722053?v=3","gravatar_id":"","url":"https://api.github.com/users/DaEkstrim","html_url":"https://github.com/DaEkstrim","followers_url":"https://api.github.com/users/DaEkstrim/followers","following_url":"https://api.github.com/users/DaEkstrim/following{/other_user}","gists_url":"https://api.github.com/users/DaEkstrim/gists{/gist_id}","starred_url":"https://api.github.com/users/DaEkstrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaEkstrim/subscriptions","organizations_url":"https://api.github.com/users/DaEkstrim/orgs","repos_url":"https://api.github.com/users/DaEkstrim/repos","events_url":"https://api.github.com/users/DaEkstrim/events{/privacy}","received_events_url":"https://api.github.com/users/DaEkstrim/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T13:48:47Z","updated_at":"2016-05-23T13:48:47Z","body":"Thanks a lot for the feedback @dotnetjunkie. I'm in awe at the depth and quality of your response. I have run your post with the team and your suggested proxy approach to the problem, and we all agreed that this solution addresses our core concerns. We might even go one step further and use interception with dynamically typed proxies that are use the `ITenantContext` to deduce to which implementation the method calls will be forwarded to.\r\n\r\nWhich in the end means that even though this was not really a SimpleInjector issue but rather a pattern of approach to the problem, you still took your time to provide us with a solution. And for that we are truly grateful. Hopefully future readers will find this post helpful as well. Thanks once again."}}
{"actor":{"display_login":"DaEkstrim"}}