{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/comments/73610100","id":73610100,"diff_hunk":"@@ -175,6 +179,28 @@ internal Silo(string name, SiloType siloType, ClusterConfiguration config, ILoca\n             globalConfig = config.Globals;\n             config.OnConfigChange(\"Defaults\", () => nodeConfig = config.GetOrCreateNodeConfigurationForSilo(name));\n \n+            // Configure DI using Startup type\n+            bool usingCustomServiceProvider;\n+            Action<IServiceCollection> configureServices = serviceCollection =>\n+            {\n+                serviceCollection.AddSingleton(this);","path":"src/OrleansRuntime/Silo/Silo.cs","position":19,"original_position":19,"commit_id":"791b0781b7b2bb78349ad4fc38603e777cb9d143","original_commit_id":"791b0781b7b2bb78349ad4fc38603e777cb9d143","user":{"login":"jdom","id":1361686,"avatar_url":"https://avatars.githubusercontent.com/u/1361686?v=3","gravatar_id":"","url":"https://api.github.com/users/jdom","html_url":"https://github.com/jdom","followers_url":"https://api.github.com/users/jdom/followers","following_url":"https://api.github.com/users/jdom/following{/other_user}","gists_url":"https://api.github.com/users/jdom/gists{/gist_id}","starred_url":"https://api.github.com/users/jdom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdom/subscriptions","organizations_url":"https://api.github.com/users/jdom/orgs","repos_url":"https://api.github.com/users/jdom/repos","events_url":"https://api.github.com/users/jdom/events{/privacy}","received_events_url":"https://api.github.com/users/jdom/received_events","type":"User","site_admin":false},"body":"careful that you are passing `this` (and resolving it afterwards) before this object finished constructing. This can lead to very hard to troubleshoot errors, since people might resolve it and try to use it in different ways","created_at":"2016-08-04T21:56:03Z","updated_at":"2016-08-04T21:56:03Z","html_url":"https://github.com/dotnet/orleans/pull/2009#discussion_r73610100","pull_request_url":"https://api.github.com/repos/dotnet/orleans/pulls/2009","_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments/73610100"},"html":{"href":"https://github.com/dotnet/orleans/pull/2009#discussion_r73610100"},"pull_request":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/2009"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/2009","id":79715088,"html_url":"https://github.com/dotnet/orleans/pull/2009","diff_url":"https://github.com/dotnet/orleans/pull/2009.diff","patch_url":"https://github.com/dotnet/orleans/pull/2009.patch","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/2009","number":2009,"state":"open","locked":false,"title":"Optionally configure Dependency Injection container using delegate.","user":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"body":"This PR allows Dependency Injection to be configured using a delegate instead of only the `StartupTypeName` method used today. The existing method is still available. They are mutually exclusive and an exception will be thrown is a user tries to set both.\r\n\r\nDelegate-based configuration allows for much more flexibility over the existing system, which requires the use of static variables to provide runtime configuration. Eg, how do I provide services from an existing container (maybe shared with ASP.NET) using the current system? The only answer I can come up with is to use global static variables - which clearly wont suffice.","created_at":"2016-08-02T10:56:53Z","updated_at":"2016-08-04T21:56:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3af956f9e767f72e99b92120f5a10188f3346f7a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/orleans/pulls/2009/commits","review_comments_url":"https://api.github.com/repos/dotnet/orleans/pulls/2009/comments","review_comment_url":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/2009/comments","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/791b0781b7b2bb78349ad4fc38603e777cb9d143","head":{"label":"ReubenBond:feature-di-delegate","ref":"feature-di-delegate","sha":"791b0781b7b2bb78349ad4fc38603e777cb9d143","user":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"repo":{"id":30130910,"name":"orleans","full_name":"ReubenBond/orleans","owner":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ReubenBond/orleans","description":"Repo for Orleans - Distributed Actor Model","fork":true,"url":"https://api.github.com/repos/ReubenBond/orleans","forks_url":"https://api.github.com/repos/ReubenBond/orleans/forks","keys_url":"https://api.github.com/repos/ReubenBond/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReubenBond/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReubenBond/orleans/teams","hooks_url":"https://api.github.com/repos/ReubenBond/orleans/hooks","issue_events_url":"https://api.github.com/repos/ReubenBond/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/ReubenBond/orleans/events","assignees_url":"https://api.github.com/repos/ReubenBond/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/ReubenBond/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/ReubenBond/orleans/tags","blobs_url":"https://api.github.com/repos/ReubenBond/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReubenBond/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReubenBond/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReubenBond/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReubenBond/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/ReubenBond/orleans/languages","stargazers_url":"https://api.github.com/repos/ReubenBond/orleans/stargazers","contributors_url":"https://api.github.com/repos/ReubenBond/orleans/contributors","subscribers_url":"https://api.github.com/repos/ReubenBond/orleans/subscribers","subscription_url":"https://api.github.com/repos/ReubenBond/orleans/subscription","commits_url":"https://api.github.com/repos/ReubenBond/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReubenBond/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReubenBond/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReubenBond/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReubenBond/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/ReubenBond/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReubenBond/orleans/merges","archive_url":"https://api.github.com/repos/ReubenBond/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReubenBond/orleans/downloads","issues_url":"https://api.github.com/repos/ReubenBond/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/ReubenBond/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/ReubenBond/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/ReubenBond/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReubenBond/orleans/labels{/name}","releases_url":"https://api.github.com/repos/ReubenBond/orleans/releases{/id}","deployments_url":"https://api.github.com/repos/ReubenBond/orleans/deployments","created_at":"2015-02-01T00:06:08Z","updated_at":"2016-02-03T21:46:28Z","pushed_at":"2016-08-02T10:57:35Z","git_url":"git://github.com/ReubenBond/orleans.git","ssh_url":"git@github.com:ReubenBond/orleans.git","clone_url":"https://github.com/ReubenBond/orleans.git","svn_url":"https://github.com/ReubenBond/orleans","homepage":"","size":26940,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"319d2cad5cc94e2fcfe8c0bc2a1c1ce8eceebdc8","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28232663,"name":"orleans","full_name":"dotnet/orleans","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":false,"url":"https://api.github.com/repos/dotnet/orleans","forks_url":"https://api.github.com/repos/dotnet/orleans/forks","keys_url":"https://api.github.com/repos/dotnet/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/orleans/teams","hooks_url":"https://api.github.com/repos/dotnet/orleans/hooks","issue_events_url":"https://api.github.com/repos/dotnet/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/orleans/events","assignees_url":"https://api.github.com/repos/dotnet/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/orleans/tags","blobs_url":"https://api.github.com/repos/dotnet/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/orleans/languages","stargazers_url":"https://api.github.com/repos/dotnet/orleans/stargazers","contributors_url":"https://api.github.com/repos/dotnet/orleans/contributors","subscribers_url":"https://api.github.com/repos/dotnet/orleans/subscribers","subscription_url":"https://api.github.com/repos/dotnet/orleans/subscription","commits_url":"https://api.github.com/repos/dotnet/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/orleans/merges","archive_url":"https://api.github.com/repos/dotnet/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/orleans/downloads","issues_url":"https://api.github.com/repos/dotnet/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/orleans/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/orleans/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/orleans/deployments","created_at":"2014-12-19T14:32:50Z","updated_at":"2016-08-04T19:15:36Z","pushed_at":"2016-08-04T21:31:36Z","git_url":"git://github.com/dotnet/orleans.git","ssh_url":"git@github.com:dotnet/orleans.git","clone_url":"https://github.com/dotnet/orleans.git","svn_url":"https://github.com/dotnet/orleans","homepage":"http://dotnet.github.io/orleans","size":46765,"stargazers_count":2102,"watchers_count":2102,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":519,"mirror_url":null,"open_issues_count":230,"forks":519,"open_issues":230,"watchers":2102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/2009"},"html":{"href":"https://github.com/dotnet/orleans/pull/2009"},"issue":{"href":"https://api.github.com/repos/dotnet/orleans/issues/2009"},"comments":{"href":"https://api.github.com/repos/dotnet/orleans/issues/2009/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/2009/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/2009/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/orleans/statuses/791b0781b7b2bb78349ad4fc38603e777cb9d143"}}}}
{"actor":{"display_login":"jdom"}}