{"action":"created","issue":{"url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions/issues/3","repository_url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions","labels_url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions/issues/3/comments","events_url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions/issues/3/events","html_url":"https://github.com/holgerleichsenring/AutofacOnFunctions/issues/3","id":352339019,"node_id":"MDU6SXNzdWUzNTIzMzkwMTk=","number":3,"title":"Reading execution context from bootstrapper","user":{"login":"reggiepangilinan-s5","id":40283569,"node_id":"MDQ6VXNlcjQwMjgzNTY5","avatar_url":"https://avatars2.githubusercontent.com/u/40283569?v=4","gravatar_id":"","url":"https://api.github.com/users/reggiepangilinan-s5","html_url":"https://github.com/reggiepangilinan-s5","followers_url":"https://api.github.com/users/reggiepangilinan-s5/followers","following_url":"https://api.github.com/users/reggiepangilinan-s5/following{/other_user}","gists_url":"https://api.github.com/users/reggiepangilinan-s5/gists{/gist_id}","starred_url":"https://api.github.com/users/reggiepangilinan-s5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggiepangilinan-s5/subscriptions","organizations_url":"https://api.github.com/users/reggiepangilinan-s5/orgs","repos_url":"https://api.github.com/users/reggiepangilinan-s5/repos","events_url":"https://api.github.com/users/reggiepangilinan-s5/events{/privacy}","received_events_url":"https://api.github.com/users/reggiepangilinan-s5/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-21T00:11:05Z","updated_at":"2018-10-10T13:15:52Z","closed_at":"2018-08-27T10:47:56Z","author_association":"NONE","body":"Is there a way to access to `ExecutionContext` of the function in the bootstrapper?\r\n\r\ne.g.\r\n\r\n```\r\n    public class Bootstrapper : IBootstrapper\r\n    {\r\n        private readonly ExecutionContext context;\r\n\r\n        Bootstrapper(ExecutionContext context) {\r\n            this.context = context;\r\n        }\r\n        public Module[] CreateModules()\r\n        {\r\n            return new Module[]\r\n            {\r\n                new FunctionModules(context)\r\n            };\r\n        }\r\n    } \r\n```\r\n\r\nTo read the applicationsettings and pass those values in the services being registered in the modules?"},"comment":{"url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions/issues/comments/428566930","html_url":"https://github.com/holgerleichsenring/AutofacOnFunctions/issues/3#issuecomment-428566930","issue_url":"https://api.github.com/repos/holgerleichsenring/AutofacOnFunctions/issues/3","id":428566930,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODU2NjkzMA==","user":{"login":"holgerleichsenring","id":10955533,"node_id":"MDQ6VXNlcjEwOTU1NTMz","avatar_url":"https://avatars3.githubusercontent.com/u/10955533?v=4","gravatar_id":"","url":"https://api.github.com/users/holgerleichsenring","html_url":"https://github.com/holgerleichsenring","followers_url":"https://api.github.com/users/holgerleichsenring/followers","following_url":"https://api.github.com/users/holgerleichsenring/following{/other_user}","gists_url":"https://api.github.com/users/holgerleichsenring/gists{/gist_id}","starred_url":"https://api.github.com/users/holgerleichsenring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holgerleichsenring/subscriptions","organizations_url":"https://api.github.com/users/holgerleichsenring/orgs","repos_url":"https://api.github.com/users/holgerleichsenring/repos","events_url":"https://api.github.com/users/holgerleichsenring/events{/privacy}","received_events_url":"https://api.github.com/users/holgerleichsenring/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T13:15:52Z","updated_at":"2018-10-10T13:15:52Z","author_association":"OWNER","body":"oh, that's interesting. I just had the same issue when reading configuration information locally or in cloud. The issue ist, that ExecutionContext really doesn't fit the concept of dependency injection. When the context is pushed to the function, the components that may rely on the configuration have to be created already.\r\n\r\nAre you sure, that Directory.GetCurrentDirectory() always works?\r\n\r\nAnyway, there should be some kind of hock into AutofacOnFunctions for \r\n- Providing Configuration, e.g. as an IConfigurationReader that hides the initialization or defining a hook that consumers of AutofacOnFunctions can introduce that on their own\r\n- Adding a hook for other logging libraries. Also configuring log4net or serilog or the like leads to code directly in function or in bootstrapper.\r\n\r\nMany thanks!"}}
{"actor":{"display_login":"holgerleichsenring"}}