{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Entropy/pulls/comments/57111262","id":57111262,"diff_hunk":"@@ -0,0 +1,65 @@\n+﻿// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using System;\n+using System.IO;\n+\n+namespace Microsoft.Extensions.Configuration.ConfigFile\n+{\n+    public static class ConfigFileConfigurationProviderExtensions\n+    {\n+        /// <summary>\n+        /// Adds configuration values of a *.config file to the ConfigurationBuilder\n+        /// </summary>\n+        /// <param name=\"builder\">Builder to add configuration values to</param>\n+        /// <param name=\"configContents\">Contents of *.config file</param>\n+        /// <param name=\"parsers\">Additional parsers to use to parse the config contents</param>\n+        public static IConfigurationBuilder AddConfiguration(this IConfigurationBuilder builder, string configContents, params IConfigurationParser[] parsers)\n+        {\n+            if (configContents == null)\n+            {\n+                throw new ArgumentNullException(nameof(configContents), \"Contents for configuration cannot be null!\");\n+            }\n+            else if (string.IsNullOrEmpty(configContents))\n+            {\n+                throw new ArgumentException(nameof(configContents), \"Contents for configuration cannot be empty!\");\n+            }\n+\n+            return builder.Add(new ConfigFileConfigurationProvider(configContents, false, false, parsers));\n+        }\n+\n+        /// <summary>\n+        /// Adds configuration values for a *.config file to the ConfigurationBuilder\n+        /// </summary>\n+        /// <param name=\"builder\">Builder to add configuration values to</param>\n+        /// <param name=\"path\">Path to *.config file</param>\n+        public static IConfigurationBuilder AddConfigFile(this IConfigurationBuilder builder, string path)\n+        {\n+            return builder.AddConfigFile(path, optional: false);\n+        }\n+\n+        /// <summary>\n+        /// Adds configuration values for a *.config file to the ConfigurationBuilder\n+        /// </summary>\n+        /// <param name=\"builder\">Builder to add configuration values to</param>\n+        /// <param name=\"path\">Path to *.config file</param>\n+        /// <param name=\"optional\">true if file is optional; false otherwise</param>\n+        /// <param name=\"parsers\">Additional parsers to use to parse the config file</param>\n+        public static IConfigurationBuilder AddConfigFile(this IConfigurationBuilder builder, string path, bool optional, params IConfigurationParser[] parsers)\n+        {\n+            if (string.IsNullOrEmpty(path))\n+            {\n+                throw new ArgumentNullException(nameof(path), \"Path for configuration cannot be null/empty!\");","path":"samples/Config.CustomConfigurationProviders.Web/Microsoft.Extensions.Configuration.ConfigFile/ConfigFileConfigurationProviderExtensions.cs","position":52,"original_position":52,"commit_id":"16c14356431df28af731994a49823fba6f540220","original_commit_id":"16c14356431df28af731994a49823fba6f540220","user":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"body":"Exception type mismatch.","created_at":"2016-03-23T05:19:56Z","updated_at":"2016-03-23T05:19:56Z","html_url":"https://github.com/aspnet/Entropy/pull/109#discussion_r57111262","pull_request_url":"https://api.github.com/repos/aspnet/Entropy/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Entropy/pulls/comments/57111262"},"html":{"href":"https://github.com/aspnet/Entropy/pull/109#discussion_r57111262"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Entropy/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Entropy/pulls/109","id":63610410,"html_url":"https://github.com/aspnet/Entropy/pull/109","diff_url":"https://github.com/aspnet/Entropy/pull/109.diff","patch_url":"https://github.com/aspnet/Entropy/pull/109.patch","issue_url":"https://api.github.com/repos/aspnet/Entropy/issues/109","number":109,"state":"open","locked":false,"title":"Adding custom ConfigurationProvider to parse *.config","user":{"login":"conniey","id":10136526,"avatar_url":"https://avatars.githubusercontent.com/u/10136526?v=3","gravatar_id":"","url":"https://api.github.com/users/conniey","html_url":"https://github.com/conniey","followers_url":"https://api.github.com/users/conniey/followers","following_url":"https://api.github.com/users/conniey/following{/other_user}","gists_url":"https://api.github.com/users/conniey/gists{/gist_id}","starred_url":"https://api.github.com/users/conniey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conniey/subscriptions","organizations_url":"https://api.github.com/users/conniey/orgs","repos_url":"https://api.github.com/users/conniey/repos","events_url":"https://api.github.com/users/conniey/events{/privacy}","received_events_url":"https://api.github.com/users/conniey/received_events","type":"User","site_admin":false},"body":"This adds a parser that can parse *.config files. An example of the types of content it can parse is in the `Web.config`\r\n","created_at":"2016-03-21T18:28:56Z","updated_at":"2016-03-23T05:19:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9d7489fb2e3f6550ce8eed4e16cf87a76d56e1d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Entropy/pulls/109/commits","review_comments_url":"https://api.github.com/repos/aspnet/Entropy/pulls/109/comments","review_comment_url":"https://api.github.com/repos/aspnet/Entropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Entropy/issues/109/comments","statuses_url":"https://api.github.com/repos/aspnet/Entropy/statuses/16c14356431df28af731994a49823fba6f540220","head":{"label":"conniey:addConfigurationProviders","ref":"addConfigurationProviders","sha":"16c14356431df28af731994a49823fba6f540220","user":{"login":"conniey","id":10136526,"avatar_url":"https://avatars.githubusercontent.com/u/10136526?v=3","gravatar_id":"","url":"https://api.github.com/users/conniey","html_url":"https://github.com/conniey","followers_url":"https://api.github.com/users/conniey/followers","following_url":"https://api.github.com/users/conniey/following{/other_user}","gists_url":"https://api.github.com/users/conniey/gists{/gist_id}","starred_url":"https://api.github.com/users/conniey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conniey/subscriptions","organizations_url":"https://api.github.com/users/conniey/orgs","repos_url":"https://api.github.com/users/conniey/repos","events_url":"https://api.github.com/users/conniey/events{/privacy}","received_events_url":"https://api.github.com/users/conniey/received_events","type":"User","site_admin":false},"repo":{"id":53758057,"name":"Entropy","full_name":"conniey/Entropy","owner":{"login":"conniey","id":10136526,"avatar_url":"https://avatars.githubusercontent.com/u/10136526?v=3","gravatar_id":"","url":"https://api.github.com/users/conniey","html_url":"https://github.com/conniey","followers_url":"https://api.github.com/users/conniey/followers","following_url":"https://api.github.com/users/conniey/following{/other_user}","gists_url":"https://api.github.com/users/conniey/gists{/gist_id}","starred_url":"https://api.github.com/users/conniey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conniey/subscriptions","organizations_url":"https://api.github.com/users/conniey/orgs","repos_url":"https://api.github.com/users/conniey/repos","events_url":"https://api.github.com/users/conniey/events{/privacy}","received_events_url":"https://api.github.com/users/conniey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/conniey/Entropy","description":"A chaotic experimental playground for new features and ideas - check here for small and simple samples for individual features.","fork":true,"url":"https://api.github.com/repos/conniey/Entropy","forks_url":"https://api.github.com/repos/conniey/Entropy/forks","keys_url":"https://api.github.com/repos/conniey/Entropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conniey/Entropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conniey/Entropy/teams","hooks_url":"https://api.github.com/repos/conniey/Entropy/hooks","issue_events_url":"https://api.github.com/repos/conniey/Entropy/issues/events{/number}","events_url":"https://api.github.com/repos/conniey/Entropy/events","assignees_url":"https://api.github.com/repos/conniey/Entropy/assignees{/user}","branches_url":"https://api.github.com/repos/conniey/Entropy/branches{/branch}","tags_url":"https://api.github.com/repos/conniey/Entropy/tags","blobs_url":"https://api.github.com/repos/conniey/Entropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conniey/Entropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conniey/Entropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/conniey/Entropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conniey/Entropy/statuses/{sha}","languages_url":"https://api.github.com/repos/conniey/Entropy/languages","stargazers_url":"https://api.github.com/repos/conniey/Entropy/stargazers","contributors_url":"https://api.github.com/repos/conniey/Entropy/contributors","subscribers_url":"https://api.github.com/repos/conniey/Entropy/subscribers","subscription_url":"https://api.github.com/repos/conniey/Entropy/subscription","commits_url":"https://api.github.com/repos/conniey/Entropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/conniey/Entropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/conniey/Entropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/conniey/Entropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/conniey/Entropy/contents/{+path}","compare_url":"https://api.github.com/repos/conniey/Entropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conniey/Entropy/merges","archive_url":"https://api.github.com/repos/conniey/Entropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conniey/Entropy/downloads","issues_url":"https://api.github.com/repos/conniey/Entropy/issues{/number}","pulls_url":"https://api.github.com/repos/conniey/Entropy/pulls{/number}","milestones_url":"https://api.github.com/repos/conniey/Entropy/milestones{/number}","notifications_url":"https://api.github.com/repos/conniey/Entropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conniey/Entropy/labels{/name}","releases_url":"https://api.github.com/repos/conniey/Entropy/releases{/id}","deployments_url":"https://api.github.com/repos/conniey/Entropy/deployments","created_at":"2016-03-12T23:17:36Z","updated_at":"2016-03-12T23:17:38Z","pushed_at":"2016-03-23T03:57:27Z","git_url":"git://github.com/conniey/Entropy.git","ssh_url":"git@github.com:conniey/Entropy.git","clone_url":"https://github.com/conniey/Entropy.git","svn_url":"https://github.com/conniey/Entropy","homepage":"","size":1743,"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":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"915504a88ee2bff4e3d8b5a59843a9ecfc1f27f5","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":17118033,"name":"Entropy","full_name":"aspnet/Entropy","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Entropy","description":"A chaotic experimental playground for new features and ideas - check here for small and simple samples for individual features.","fork":false,"url":"https://api.github.com/repos/aspnet/Entropy","forks_url":"https://api.github.com/repos/aspnet/Entropy/forks","keys_url":"https://api.github.com/repos/aspnet/Entropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Entropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Entropy/teams","hooks_url":"https://api.github.com/repos/aspnet/Entropy/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Entropy/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Entropy/events","assignees_url":"https://api.github.com/repos/aspnet/Entropy/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Entropy/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Entropy/tags","blobs_url":"https://api.github.com/repos/aspnet/Entropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Entropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Entropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Entropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Entropy/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Entropy/languages","stargazers_url":"https://api.github.com/repos/aspnet/Entropy/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Entropy/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Entropy/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Entropy/subscription","commits_url":"https://api.github.com/repos/aspnet/Entropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Entropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Entropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Entropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Entropy/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Entropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Entropy/merges","archive_url":"https://api.github.com/repos/aspnet/Entropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Entropy/downloads","issues_url":"https://api.github.com/repos/aspnet/Entropy/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Entropy/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Entropy/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Entropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Entropy/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Entropy/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/Entropy/deployments","created_at":"2014-02-23T21:52:49Z","updated_at":"2016-03-20T03:24:57Z","pushed_at":"2016-03-23T03:57:27Z","git_url":"git://github.com/aspnet/Entropy.git","ssh_url":"git@github.com:aspnet/Entropy.git","clone_url":"https://github.com/aspnet/Entropy.git","svn_url":"https://github.com/aspnet/Entropy","homepage":"","size":2148,"stargazers_count":119,"watchers_count":119,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":11,"forks":43,"open_issues":11,"watchers":119,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Entropy/pulls/109"},"html":{"href":"https://github.com/aspnet/Entropy/pull/109"},"issue":{"href":"https://api.github.com/repos/aspnet/Entropy/issues/109"},"comments":{"href":"https://api.github.com/repos/aspnet/Entropy/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Entropy/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Entropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Entropy/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Entropy/statuses/16c14356431df28af731994a49823fba6f540220"}}}}