{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments/218151941","pull_request_review_id":156027776,"id":218151941,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODE1MTk0MQ==","diff_hunk":"@@ -94,39 +96,48 @@ private BindingDataResolver GetResolver(PropertyInfo propInfo, INameResolver nam\n         {\n             // Do the attribute lookups once upfront, and then cache them (via func closures) for subsequent runtime usage. \n             object originalValue = propInfo.GetValue(_source);\n+            ConnectionStringAttribute connStrAttr = propInfo.GetCustomAttribute<ConnectionStringAttribute>();\n             AppSettingAttribute appSettingAttr = propInfo.GetCustomAttribute<AppSettingAttribute>();\n             AutoResolveAttribute autoResolveAttr = propInfo.GetCustomAttribute<AutoResolveAttribute>();\n             Validator validator = GetValidatorFunc(propInfo, appSettingAttr != null);\n \n-            if (appSettingAttr == null && autoResolveAttr == null)\n+            if (appSettingAttr == null && autoResolveAttr == null && connStrAttr == null)\n             {\n                 validator(originalValue);\n \n                 // No special attributes, treat as literal. \n                 return (newAttr, bindingData) => originalValue;\n             }\n \n-            if (appSettingAttr != null && autoResolveAttr != null)\n+            int attrCount = new Attribute[] { connStrAttr, appSettingAttr, autoResolveAttr }.Count(a => a != null);\n+            if (attrCount > 1)\n             {\n-                throw new InvalidOperationException($\"Property '{propInfo.Name}' cannot be annotated with both AppSetting and AutoResolve.\");\n+                throw new InvalidOperationException($\"Property '{propInfo.Name}' can only be annotated with one of the types {nameof(AppSettingAttribute)}, {nameof(AutoResolveAttribute)}, and {nameof(ConnectionStringAttribute)}.\");\n             }\n \n             // attributes only work on string properties. \n             if (propInfo.PropertyType != typeof(string))\n             {\n-                throw new InvalidOperationException($\"AutoResolve or AppSetting property '{propInfo.Name}' must be of type string.\");\n+                throw new InvalidOperationException($\"{nameof(ConnectionStringAttribute)}, {nameof(AutoResolveAttribute)}, or {nameof(AppSettingAttribute)} property '{propInfo.Name}' must be of type string.\");","path":"src/Microsoft.Azure.WebJobs.Host/Bindings/AttributeCloner.cs","position":78,"original_position":78,"commit_id":"b0f9184825e841f5b363b3bdba8fb717e8aa254d","original_commit_id":"b0f9184825e841f5b363b3bdba8fb717e8aa254d","user":{"login":"fabiocav","id":2507935,"node_id":"MDQ6VXNlcjI1MDc5MzU=","avatar_url":"https://avatars2.githubusercontent.com/u/2507935?v=4","gravatar_id":"","url":"https://api.github.com/users/fabiocav","html_url":"https://github.com/fabiocav","followers_url":"https://api.github.com/users/fabiocav/followers","following_url":"https://api.github.com/users/fabiocav/following{/other_user}","gists_url":"https://api.github.com/users/fabiocav/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiocav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiocav/subscriptions","organizations_url":"https://api.github.com/users/fabiocav/orgs","repos_url":"https://api.github.com/users/fabiocav/repos","events_url":"https://api.github.com/users/fabiocav/events{/privacy}","received_events_url":"https://api.github.com/users/fabiocav/received_events","type":"User","site_admin":false},"body":"Eventually, it would be nice to have an analyzer for this restriction to make sure we're failing at compile time.","created_at":"2018-09-17T17:09:23Z","updated_at":"2018-09-17T17:34:21Z","html_url":"https://github.com/Azure/azure-webjobs-sdk/pull/1910#discussion_r218151941","pull_request_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments/218151941"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk/pull/1910#discussion_r218151941"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910","id":215775909,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1Nzc1OTA5","html_url":"https://github.com/Azure/azure-webjobs-sdk/pull/1910","diff_url":"https://github.com/Azure/azure-webjobs-sdk/pull/1910.diff","patch_url":"https://github.com/Azure/azure-webjobs-sdk/pull/1910.patch","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1910","number":1910,"state":"open","locked":false,"title":"Adding support for [ConnectionString] attribute on binding attribute properties","user":{"login":"brettsam","id":1089915,"node_id":"MDQ6VXNlcjEwODk5MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1089915?v=4","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"body":"Allows binding attributes to set `[ConnectionString]` (as opposed to `[AppSetting]`, which instructs the attribute cloner to look up the key with `IConfiguration.GetConnectionString()` first, before falling back to the root configuration.","created_at":"2018-09-15T15:58:53Z","updated_at":"2018-09-17T17:34:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f045de0d3e7c36a3cfba8472124fbc9a3bb6b92","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mathewc","id":1056548,"node_id":"MDQ6VXNlcjEwNTY1NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1056548?v=4","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1910/comments","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/b0f9184825e841f5b363b3bdba8fb717e8aa254d","head":{"label":"brettsam:connstrattr","ref":"connstrattr","sha":"b0f9184825e841f5b363b3bdba8fb717e8aa254d","user":{"login":"brettsam","id":1089915,"node_id":"MDQ6VXNlcjEwODk5MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1089915?v=4","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"repo":{"id":52930359,"node_id":"MDEwOlJlcG9zaXRvcnk1MjkzMDM1OQ==","name":"azure-webjobs-sdk","full_name":"brettsam/azure-webjobs-sdk","private":false,"owner":{"login":"brettsam","id":1089915,"node_id":"MDQ6VXNlcjEwODk5MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1089915?v=4","gravatar_id":"","url":"https://api.github.com/users/brettsam","html_url":"https://github.com/brettsam","followers_url":"https://api.github.com/users/brettsam/followers","following_url":"https://api.github.com/users/brettsam/following{/other_user}","gists_url":"https://api.github.com/users/brettsam/gists{/gist_id}","starred_url":"https://api.github.com/users/brettsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettsam/subscriptions","organizations_url":"https://api.github.com/users/brettsam/orgs","repos_url":"https://api.github.com/users/brettsam/repos","events_url":"https://api.github.com/users/brettsam/events{/privacy}","received_events_url":"https://api.github.com/users/brettsam/received_events","type":"User","site_admin":false},"html_url":"https://github.com/brettsam/azure-webjobs-sdk","description":"Azure WebJobs SDK","fork":true,"url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk","forks_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/forks","keys_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/teams","hooks_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/hooks","issue_events_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/events","assignees_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/tags","blobs_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/languages","stargazers_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/stargazers","contributors_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/contributors","subscribers_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/subscribers","subscription_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/subscription","commits_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/merges","archive_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/downloads","issues_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/labels{/name}","releases_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/brettsam/azure-webjobs-sdk/deployments","created_at":"2016-03-02T03:26:09Z","updated_at":"2016-03-02T03:26:14Z","pushed_at":"2018-09-15T15:58:45Z","git_url":"git://github.com/brettsam/azure-webjobs-sdk.git","ssh_url":"git@github.com:brettsam/azure-webjobs-sdk.git","clone_url":"https://github.com/brettsam/azure-webjobs-sdk.git","svn_url":"https://github.com/brettsam/azure-webjobs-sdk","homepage":"","size":19938,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"eeb0744bf23d2ce025062a3d33e07ad58a605b8f","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":21712185,"node_id":"MDEwOlJlcG9zaXRvcnkyMTcxMjE4NQ==","name":"azure-webjobs-sdk","full_name":"Azure/azure-webjobs-sdk","private":false,"owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Azure/azure-webjobs-sdk","description":"Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/deployments","created_at":"2014-07-10T22:15:31Z","updated_at":"2018-09-14T23:43:58Z","pushed_at":"2018-09-17T17:19:39Z","git_url":"git://github.com/Azure/azure-webjobs-sdk.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk","homepage":"","size":19480,"stargazers_count":371,"watchers_count":371,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":186,"mirror_url":null,"archived":false,"open_issues_count":409,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":186,"open_issues":409,"watchers":371,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk/pull/1910"},"issue":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1910"},"comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1910/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/1910/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/b0f9184825e841f5b363b3bdba8fb717e8aa254d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"fabiocav"}}