{"action":"created","comment":{"url":"https://api.github.com/repos/OData/RESTier/pulls/comments/53163765","id":53163765,"diff_hunk":"@@ -0,0 +1,60 @@\n+﻿// Copyright (c) Microsoft Corporation.  All rights reserved.\n+// Licensed under the MIT License.  See License.txt in the project root for license information.\n+\n+using System;\n+using System.Linq;\n+using Microsoft.Framework.DependencyInjection;\n+using Microsoft.Restier.Core.Query;\n+\n+namespace Microsoft.Restier.Core\n+{\n+    /// <summary>\n+    /// A delegate which participate in service creation.\n+    /// All registered contributors form a chain, and the last registered will be called first.\n+    /// </summary>\n+    /// <typeparam name=\"T\">The service type.</typeparam>\n+    /// <param name=\"serviceProvider\">\n+    /// The <see cref=\"IServiceProvider\"/> to which this contributor call is registered.\n+    /// </param>\n+    /// <param name=\"next\">\n+    /// Return the result of the previous contributor on the chain.\n+    /// </param>\n+    /// <returns>A service instance of <typeparamref name=\"T\"/>.</returns>\n+    public delegate T ApiServiceContributor<T>(IServiceProvider serviceProvider, Func<T> next) where T : class;\n+\n+    /// <summary>\n+    /// Builder object to create an <see cref=\"ApiConfiguration\"/>\n+    /// </summary>\n+    [CLSCompliant(false)]","path":"src/Microsoft.Restier.Core/ApiBuilder.cs","position":28,"original_position":28,"commit_id":"c834d95c67d5ec20346c611ef9aa7edcf3291bd8","original_commit_id":"c834d95c67d5ec20346c611ef9aa7edcf3291bd8","user":{"login":"rayao","id":9673549,"avatar_url":"https://avatars.githubusercontent.com/u/9673549?v=3","gravatar_id":"","url":"https://api.github.com/users/rayao","html_url":"https://github.com/rayao","followers_url":"https://api.github.com/users/rayao/followers","following_url":"https://api.github.com/users/rayao/following{/other_user}","gists_url":"https://api.github.com/users/rayao/gists{/gist_id}","starred_url":"https://api.github.com/users/rayao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayao/subscriptions","organizations_url":"https://api.github.com/users/rayao/orgs","repos_url":"https://api.github.com/users/rayao/repos","events_url":"https://api.github.com/users/rayao/events{/privacy}","received_events_url":"https://api.github.com/users/rayao/received_events","type":"User","site_admin":false},"body":"Make ApiBuilder CLSCompliant, so that all other occurences are no longer necessary. Thank you!","created_at":"2016-02-17T13:37:57Z","updated_at":"2016-02-17T13:37:57Z","html_url":"https://github.com/OData/RESTier/pull/285#discussion_r53163765","pull_request_url":"https://api.github.com/repos/OData/RESTier/pulls/285","_links":{"self":{"href":"https://api.github.com/repos/OData/RESTier/pulls/comments/53163765"},"html":{"href":"https://github.com/OData/RESTier/pull/285#discussion_r53163765"},"pull_request":{"href":"https://api.github.com/repos/OData/RESTier/pulls/285"}}},"pull_request":{"url":"https://api.github.com/repos/OData/RESTier/pulls/285","id":57763879,"html_url":"https://github.com/OData/RESTier/pull/285","diff_url":"https://github.com/OData/RESTier/pull/285.diff","patch_url":"https://github.com/OData/RESTier/pull/285.patch","issue_url":"https://api.github.com/repos/OData/RESTier/issues/285","number":285,"state":"open","locked":false,"title":"Microsoft.FX.DI integration [Option 1]","user":{"login":"rayao","id":9673549,"avatar_url":"https://avatars.githubusercontent.com/u/9673549?v=3","gravatar_id":"","url":"https://api.github.com/users/rayao","html_url":"https://github.com/rayao","followers_url":"https://api.github.com/users/rayao/followers","following_url":"https://api.github.com/users/rayao/following{/other_user}","gists_url":"https://api.github.com/users/rayao/gists{/gist_id}","starred_url":"https://api.github.com/users/rayao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayao/subscriptions","organizations_url":"https://api.github.com/users/rayao/orgs","repos_url":"https://api.github.com/users/rayao/repos","events_url":"https://api.github.com/users/rayao/events{/privacy}","received_events_url":"https://api.github.com/users/rayao/received_events","type":"User","site_admin":false},"body":"Use Micorsoft DI framework to replace current Dictionary<,> based service registration.\r\nThis is a relatively aggressive change, compared to my previous PR. There's an option 2 #286 pull request which is basically identical to the previous PR #264. It's up to you to make a choice.\r\nIn this change the main difference is that class **ApiBuilder** is added for API service registration, and later build an ApiConfiguration.\r\nPros:\r\n- No **Committed** state for ApiConfiguration, it's committed once created. For now those related methods are not removed yet but they do nothing.\r\n- ApiConfiguration itself is registered as a service and participate in DI. That means a descendant Api class could register some service which gets an ApiConfiguration injected on construction.\r\n\r\nBut of course, at the same time this change inevitably has broader impact to existing code.\r\n- ApiConfiguration public interface changes, This breaks a lot of things, which of course are fixed with this change. But, any consumer out there may have a bigger chance to break, compared to option 2.","created_at":"2016-01-31T09:06:21Z","updated_at":"2016-02-17T13:37:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f779cfa519fb2f44c5f0b7c9d5bd82e17d7f487","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OData/RESTier/pulls/285/commits","review_comments_url":"https://api.github.com/repos/OData/RESTier/pulls/285/comments","review_comment_url":"https://api.github.com/repos/OData/RESTier/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OData/RESTier/issues/285/comments","statuses_url":"https://api.github.com/repos/OData/RESTier/statuses/c834d95c67d5ec20346c611ef9aa7edcf3291bd8","head":{"label":"rayao:DI1","ref":"DI1","sha":"c834d95c67d5ec20346c611ef9aa7edcf3291bd8","user":{"login":"rayao","id":9673549,"avatar_url":"https://avatars.githubusercontent.com/u/9673549?v=3","gravatar_id":"","url":"https://api.github.com/users/rayao","html_url":"https://github.com/rayao","followers_url":"https://api.github.com/users/rayao/followers","following_url":"https://api.github.com/users/rayao/following{/other_user}","gists_url":"https://api.github.com/users/rayao/gists{/gist_id}","starred_url":"https://api.github.com/users/rayao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayao/subscriptions","organizations_url":"https://api.github.com/users/rayao/orgs","repos_url":"https://api.github.com/users/rayao/repos","events_url":"https://api.github.com/users/rayao/events{/privacy}","received_events_url":"https://api.github.com/users/rayao/received_events","type":"User","site_admin":false},"repo":{"id":37302627,"name":"RESTier","full_name":"rayao/RESTier","owner":{"login":"rayao","id":9673549,"avatar_url":"https://avatars.githubusercontent.com/u/9673549?v=3","gravatar_id":"","url":"https://api.github.com/users/rayao","html_url":"https://github.com/rayao","followers_url":"https://api.github.com/users/rayao/followers","following_url":"https://api.github.com/users/rayao/following{/other_user}","gists_url":"https://api.github.com/users/rayao/gists{/gist_id}","starred_url":"https://api.github.com/users/rayao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayao/subscriptions","organizations_url":"https://api.github.com/users/rayao/orgs","repos_url":"https://api.github.com/users/rayao/repos","events_url":"https://api.github.com/users/rayao/events{/privacy}","received_events_url":"https://api.github.com/users/rayao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rayao/RESTier","description":"A turn-key library for building RESTful services","fork":true,"url":"https://api.github.com/repos/rayao/RESTier","forks_url":"https://api.github.com/repos/rayao/RESTier/forks","keys_url":"https://api.github.com/repos/rayao/RESTier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rayao/RESTier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rayao/RESTier/teams","hooks_url":"https://api.github.com/repos/rayao/RESTier/hooks","issue_events_url":"https://api.github.com/repos/rayao/RESTier/issues/events{/number}","events_url":"https://api.github.com/repos/rayao/RESTier/events","assignees_url":"https://api.github.com/repos/rayao/RESTier/assignees{/user}","branches_url":"https://api.github.com/repos/rayao/RESTier/branches{/branch}","tags_url":"https://api.github.com/repos/rayao/RESTier/tags","blobs_url":"https://api.github.com/repos/rayao/RESTier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rayao/RESTier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rayao/RESTier/git/refs{/sha}","trees_url":"https://api.github.com/repos/rayao/RESTier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rayao/RESTier/statuses/{sha}","languages_url":"https://api.github.com/repos/rayao/RESTier/languages","stargazers_url":"https://api.github.com/repos/rayao/RESTier/stargazers","contributors_url":"https://api.github.com/repos/rayao/RESTier/contributors","subscribers_url":"https://api.github.com/repos/rayao/RESTier/subscribers","subscription_url":"https://api.github.com/repos/rayao/RESTier/subscription","commits_url":"https://api.github.com/repos/rayao/RESTier/commits{/sha}","git_commits_url":"https://api.github.com/repos/rayao/RESTier/git/commits{/sha}","comments_url":"https://api.github.com/repos/rayao/RESTier/comments{/number}","issue_comment_url":"https://api.github.com/repos/rayao/RESTier/issues/comments{/number}","contents_url":"https://api.github.com/repos/rayao/RESTier/contents/{+path}","compare_url":"https://api.github.com/repos/rayao/RESTier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rayao/RESTier/merges","archive_url":"https://api.github.com/repos/rayao/RESTier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rayao/RESTier/downloads","issues_url":"https://api.github.com/repos/rayao/RESTier/issues{/number}","pulls_url":"https://api.github.com/repos/rayao/RESTier/pulls{/number}","milestones_url":"https://api.github.com/repos/rayao/RESTier/milestones{/number}","notifications_url":"https://api.github.com/repos/rayao/RESTier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rayao/RESTier/labels{/name}","releases_url":"https://api.github.com/repos/rayao/RESTier/releases{/id}","deployments_url":"https://api.github.com/repos/rayao/RESTier/deployments","created_at":"2015-06-12T04:50:58Z","updated_at":"2016-01-30T14:08:05Z","pushed_at":"2016-02-17T13:13:32Z","git_url":"git://github.com/rayao/RESTier.git","ssh_url":"git@github.com:rayao/RESTier.git","clone_url":"https://github.com/rayao/RESTier.git","svn_url":"https://github.com/rayao/RESTier","homepage":"http://odata.github.io/RESTier","size":3659,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"OData:master","ref":"master","sha":"28b11d5b0b3ce5e09f80ff59ddd7a7ea3b859a23","user":{"login":"OData","id":916520,"avatar_url":"https://avatars.githubusercontent.com/u/916520?v=3","gravatar_id":"","url":"https://api.github.com/users/OData","html_url":"https://github.com/OData","followers_url":"https://api.github.com/users/OData/followers","following_url":"https://api.github.com/users/OData/following{/other_user}","gists_url":"https://api.github.com/users/OData/gists{/gist_id}","starred_url":"https://api.github.com/users/OData/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OData/subscriptions","organizations_url":"https://api.github.com/users/OData/orgs","repos_url":"https://api.github.com/users/OData/repos","events_url":"https://api.github.com/users/OData/events{/privacy}","received_events_url":"https://api.github.com/users/OData/received_events","type":"Organization","site_admin":false},"repo":{"id":24577772,"name":"RESTier","full_name":"OData/RESTier","owner":{"login":"OData","id":916520,"avatar_url":"https://avatars.githubusercontent.com/u/916520?v=3","gravatar_id":"","url":"https://api.github.com/users/OData","html_url":"https://github.com/OData","followers_url":"https://api.github.com/users/OData/followers","following_url":"https://api.github.com/users/OData/following{/other_user}","gists_url":"https://api.github.com/users/OData/gists{/gist_id}","starred_url":"https://api.github.com/users/OData/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OData/subscriptions","organizations_url":"https://api.github.com/users/OData/orgs","repos_url":"https://api.github.com/users/OData/repos","events_url":"https://api.github.com/users/OData/events{/privacy}","received_events_url":"https://api.github.com/users/OData/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OData/RESTier","description":"A turn-key library for building RESTful services","fork":false,"url":"https://api.github.com/repos/OData/RESTier","forks_url":"https://api.github.com/repos/OData/RESTier/forks","keys_url":"https://api.github.com/repos/OData/RESTier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OData/RESTier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OData/RESTier/teams","hooks_url":"https://api.github.com/repos/OData/RESTier/hooks","issue_events_url":"https://api.github.com/repos/OData/RESTier/issues/events{/number}","events_url":"https://api.github.com/repos/OData/RESTier/events","assignees_url":"https://api.github.com/repos/OData/RESTier/assignees{/user}","branches_url":"https://api.github.com/repos/OData/RESTier/branches{/branch}","tags_url":"https://api.github.com/repos/OData/RESTier/tags","blobs_url":"https://api.github.com/repos/OData/RESTier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OData/RESTier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OData/RESTier/git/refs{/sha}","trees_url":"https://api.github.com/repos/OData/RESTier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OData/RESTier/statuses/{sha}","languages_url":"https://api.github.com/repos/OData/RESTier/languages","stargazers_url":"https://api.github.com/repos/OData/RESTier/stargazers","contributors_url":"https://api.github.com/repos/OData/RESTier/contributors","subscribers_url":"https://api.github.com/repos/OData/RESTier/subscribers","subscription_url":"https://api.github.com/repos/OData/RESTier/subscription","commits_url":"https://api.github.com/repos/OData/RESTier/commits{/sha}","git_commits_url":"https://api.github.com/repos/OData/RESTier/git/commits{/sha}","comments_url":"https://api.github.com/repos/OData/RESTier/comments{/number}","issue_comment_url":"https://api.github.com/repos/OData/RESTier/issues/comments{/number}","contents_url":"https://api.github.com/repos/OData/RESTier/contents/{+path}","compare_url":"https://api.github.com/repos/OData/RESTier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OData/RESTier/merges","archive_url":"https://api.github.com/repos/OData/RESTier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OData/RESTier/downloads","issues_url":"https://api.github.com/repos/OData/RESTier/issues{/number}","pulls_url":"https://api.github.com/repos/OData/RESTier/pulls{/number}","milestones_url":"https://api.github.com/repos/OData/RESTier/milestones{/number}","notifications_url":"https://api.github.com/repos/OData/RESTier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OData/RESTier/labels{/name}","releases_url":"https://api.github.com/repos/OData/RESTier/releases{/id}","deployments_url":"https://api.github.com/repos/OData/RESTier/deployments","created_at":"2014-09-29T02:54:06Z","updated_at":"2016-02-04T10:51:21Z","pushed_at":"2016-02-08T12:03:12Z","git_url":"git://github.com/OData/RESTier.git","ssh_url":"git@github.com:OData/RESTier.git","clone_url":"https://github.com/OData/RESTier.git","svn_url":"https://github.com/OData/RESTier","homepage":"http://odata.github.io/RESTier","size":5702,"stargazers_count":75,"watchers_count":75,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"open_issues_count":113,"forks":30,"open_issues":113,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OData/RESTier/pulls/285"},"html":{"href":"https://github.com/OData/RESTier/pull/285"},"issue":{"href":"https://api.github.com/repos/OData/RESTier/issues/285"},"comments":{"href":"https://api.github.com/repos/OData/RESTier/issues/285/comments"},"review_comments":{"href":"https://api.github.com/repos/OData/RESTier/pulls/285/comments"},"review_comment":{"href":"https://api.github.com/repos/OData/RESTier/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OData/RESTier/pulls/285/commits"},"statuses":{"href":"https://api.github.com/repos/OData/RESTier/statuses/c834d95c67d5ec20346c611ef9aa7edcf3291bd8"}}}}