GitHub PullRequestReviewCommentEvent at 2014-07-24 12:52:24
Repository: Daptiv.Bus
Actor: gmoskovicz
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/comments/15344067","id":15344067,"diff_hunk":"@@ -61,18 +77,40 @@ public int Update(TId id, dynamic data)\n         {\n             List<string> paramNames = GetParamNames((object)data);\n \n-            var builder = new StringBuilder();\n-            builder.Append(\"update \").Append(TableName).Append(\" set \");\n-            builder.AppendLine(string.Join(\",\", paramNames.Where(n => n != IdFieldName).Select(p => p + \"= @\" + p)));\n-            builder.Append(\"where \");\n-            builder.Append(IdFieldName);\n-            builder.Append(\" = @\");\n-            builder.Append(IdFieldName);\n+            var parameters = new DynamicParameters(data);\n+            parameters.Add(IdFieldName, id);\n+\n+            var sql = FillSqlTemplate(\n+                UpdateSql,\n+                assignments: string.Join(\",\", paramNames.Where(n => n != IdFieldName).Select(p => p + \"= @\" + p))\n+                );\n+\n+            return _database.Execute(sql, parameters);\n+        }\n+\n+        /// <summary>\n+        /// if the record exists in the Table, update it else insert it\n+        /// </summary>\n+        /// <param name=\"id\"></param>\n+        /// <param name=\"data\"></param>\n+        /// <param name=\"moreWhere\"></param>\n+        /// <returns></returns>\n+        public int Upsert(TId id, dynamic data, string moreWhere = null)","path":"Druq.Framework/Dapper/Table.cs","position":68,"original_position":68,"commit_id":"136124096e3d181398b5d37a4f9c26f3f29eac5d","original_commit_id":"136124096e3d181398b5d37a4f9c26f3f29eac5d","user":{"login":"gmoskovicz","id":1675411,"avatar_url":"https://avatars.githubusercontent.com/u/1675411?","gravatar_id":"39404c96bad4b51d846cb3489956c19e","url":"https://api.github.com/users/gmoskovicz","html_url":"https://github.com/gmoskovicz","followers_url":"https://api.github.com/users/gmoskovicz/followers","following_url":"https://api.github.com/users/gmoskovicz/following{/other_user}","gists_url":"https://api.github.com/users/gmoskovicz/gists{/gist_id}","starred_url":"https://api.github.com/users/gmoskovicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmoskovicz/subscriptions","organizations_url":"https://api.github.com/users/gmoskovicz/orgs","repos_url":"https://api.github.com/users/gmoskovicz/repos","events_url":"https://api.github.com/users/gmoskovicz/events{/privacy}","received_events_url":"https://api.github.com/users/gmoskovicz/received_events","type":"User","site_admin":false},"body":"My friend \"moreWhere\" is here too","created_at":"2014-07-24T12:52:24Z","updated_at":"2014-07-24T12:52:24Z","html_url":"https://github.com/daptiv/Daptiv.Bus/pull/56#discussion_r15344067","pull_request_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/comments/15344067"},"html":{"href":"https://github.com/daptiv/Daptiv.Bus/pull/56#discussion_r15344067"},"pull_request":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56","id":18303917,"html_url":"https://github.com/daptiv/Daptiv.Bus/pull/56","diff_url":"https://github.com/daptiv/Daptiv.Bus/pull/56.diff","patch_url":"https://github.com/daptiv/Daptiv.Bus/pull/56.patch","issue_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/56","number":56,"state":"open","title":"Idemponent","user":{"login":"drewburlingame","id":103345,"avatar_url":"https://avatars.githubusercontent.com/u/103345?","gravatar_id":"b093ff7de1152d62c0705027a780936f","url":"https://api.github.com/users/drewburlingame","html_url":"https://github.com/drewburlingame","followers_url":"https://api.github.com/users/drewburlingame/followers","following_url":"https://api.github.com/users/drewburlingame/following{/other_user}","gists_url":"https://api.github.com/users/drewburlingame/gists{/gist_id}","starred_url":"https://api.github.com/users/drewburlingame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewburlingame/subscriptions","organizations_url":"https://api.github.com/users/drewburlingame/orgs","repos_url":"https://api.github.com/users/drewburlingame/repos","events_url":"https://api.github.com/users/drewburlingame/events{/privacy}","received_events_url":"https://api.github.com/users/drewburlingame/received_events","type":"User","site_admin":false},"body":":warning: not ready for merge :warning: \r\n\r\n- [ ] add partition migration for Idempotent\r\n- [ ] update HubLifeSupport.ClearInactiveHubs to clear locked Idempotent records\r\n- [ ] add tests for IdempotencyService\r\n- [ ] add tests for MessageProcessor\r\n- [ ] test SubscriberValidator in PPM\r\n\r\noptional\r\n- [ ] find a better name than Idempotent","created_at":"2014-07-11T21:50:25Z","updated_at":"2014-07-24T12:52:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fdb28b53c329511327a146e78c6167173b18f3b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56/commits","review_comments_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56/comments","review_comment_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/comments/{number}","comments_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/56/comments","statuses_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/statuses/136124096e3d181398b5d37a4f9c26f3f29eac5d","head":{"label":"daptiv:idemponent","ref":"idemponent","sha":"136124096e3d181398b5d37a4f9c26f3f29eac5d","user":{"login":"daptiv","id":601501,"avatar_url":"https://avatars.githubusercontent.com/u/601501?","gravatar_id":"ea1e0d6922efb4b6d03e8b29f2741645","url":"https://api.github.com/users/daptiv","html_url":"https://github.com/daptiv","followers_url":"https://api.github.com/users/daptiv/followers","following_url":"https://api.github.com/users/daptiv/following{/other_user}","gists_url":"https://api.github.com/users/daptiv/gists{/gist_id}","starred_url":"https://api.github.com/users/daptiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daptiv/subscriptions","organizations_url":"https://api.github.com/users/daptiv/orgs","repos_url":"https://api.github.com/users/daptiv/repos","events_url":"https://api.github.com/users/daptiv/events{/privacy}","received_events_url":"https://api.github.com/users/daptiv/received_events","type":"Organization","site_admin":false},"repo":{"id":17488097,"name":"Daptiv.Bus","full_name":"daptiv/Daptiv.Bus","owner":{"login":"daptiv","id":601501,"avatar_url":"https://avatars.githubusercontent.com/u/601501?","gravatar_id":"ea1e0d6922efb4b6d03e8b29f2741645","url":"https://api.github.com/users/daptiv","html_url":"https://github.com/daptiv","followers_url":"https://api.github.com/users/daptiv/followers","following_url":"https://api.github.com/users/daptiv/following{/other_user}","gists_url":"https://api.github.com/users/daptiv/gists{/gist_id}","starred_url":"https://api.github.com/users/daptiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daptiv/subscriptions","organizations_url":"https://api.github.com/users/daptiv/orgs","repos_url":"https://api.github.com/users/daptiv/repos","events_url":"https://api.github.com/users/daptiv/events{/privacy}","received_events_url":"https://api.github.com/users/daptiv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/daptiv/Daptiv.Bus","description":"Temporary message bus until we can get resources for a real message bus","fork":false,"url":"https://api.github.com/repos/daptiv/Daptiv.Bus","forks_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/forks","keys_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/teams","hooks_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/hooks","issue_events_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/events{/number}","events_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/events","assignees_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/assignees{/user}","branches_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/branches{/branch}","tags_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/tags","blobs_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/refs{/sha}","trees_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/statuses/{sha}","languages_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/languages","stargazers_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/stargazers","contributors_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/contributors","subscribers_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/subscribers","subscription_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/subscription","commits_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/commits{/sha}","git_commits_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/commits{/sha}","comments_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/comments{/number}","issue_comment_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/comments/{number}","contents_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/contents/{+path}","compare_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/merges","archive_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/downloads","issues_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues{/number}","pulls_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls{/number}","milestones_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/milestones{/number}","notifications_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/labels{/name}","releases_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/releases{/id}","created_at":"2014-03-06T18:32:04Z","updated_at":"2014-07-02T21:05:59Z","pushed_at":"2014-07-21T21:42:14Z","git_url":"git://github.com/daptiv/Daptiv.Bus.git","ssh_url":"git@github.com:daptiv/Daptiv.Bus.git","clone_url":"https://github.com/daptiv/Daptiv.Bus.git","svn_url":"https://github.com/daptiv/Daptiv.Bus","homepage":null,"size":15524,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"daptiv:master","ref":"master","sha":"cf252d9cd562306babf2cd6ded8e76eb7de495e0","user":{"login":"daptiv","id":601501,"avatar_url":"https://avatars.githubusercontent.com/u/601501?","gravatar_id":"ea1e0d6922efb4b6d03e8b29f2741645","url":"https://api.github.com/users/daptiv","html_url":"https://github.com/daptiv","followers_url":"https://api.github.com/users/daptiv/followers","following_url":"https://api.github.com/users/daptiv/following{/other_user}","gists_url":"https://api.github.com/users/daptiv/gists{/gist_id}","starred_url":"https://api.github.com/users/daptiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daptiv/subscriptions","organizations_url":"https://api.github.com/users/daptiv/orgs","repos_url":"https://api.github.com/users/daptiv/repos","events_url":"https://api.github.com/users/daptiv/events{/privacy}","received_events_url":"https://api.github.com/users/daptiv/received_events","type":"Organization","site_admin":false},"repo":{"id":17488097,"name":"Daptiv.Bus","full_name":"daptiv/Daptiv.Bus","owner":{"login":"daptiv","id":601501,"avatar_url":"https://avatars.githubusercontent.com/u/601501?","gravatar_id":"ea1e0d6922efb4b6d03e8b29f2741645","url":"https://api.github.com/users/daptiv","html_url":"https://github.com/daptiv","followers_url":"https://api.github.com/users/daptiv/followers","following_url":"https://api.github.com/users/daptiv/following{/other_user}","gists_url":"https://api.github.com/users/daptiv/gists{/gist_id}","starred_url":"https://api.github.com/users/daptiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daptiv/subscriptions","organizations_url":"https://api.github.com/users/daptiv/orgs","repos_url":"https://api.github.com/users/daptiv/repos","events_url":"https://api.github.com/users/daptiv/events{/privacy}","received_events_url":"https://api.github.com/users/daptiv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/daptiv/Daptiv.Bus","description":"Temporary message bus until we can get resources for a real message bus","fork":false,"url":"https://api.github.com/repos/daptiv/Daptiv.Bus","forks_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/forks","keys_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/teams","hooks_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/hooks","issue_events_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/events{/number}","events_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/events","assignees_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/assignees{/user}","branches_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/branches{/branch}","tags_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/tags","blobs_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/refs{/sha}","trees_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/statuses/{sha}","languages_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/languages","stargazers_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/stargazers","contributors_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/contributors","subscribers_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/subscribers","subscription_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/subscription","commits_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/commits{/sha}","git_commits_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/git/commits{/sha}","comments_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/comments{/number}","issue_comment_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/comments/{number}","contents_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/contents/{+path}","compare_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/merges","archive_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/downloads","issues_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues{/number}","pulls_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls{/number}","milestones_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/milestones{/number}","notifications_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/labels{/name}","releases_url":"https://api.github.com/repos/daptiv/Daptiv.Bus/releases{/id}","created_at":"2014-03-06T18:32:04Z","updated_at":"2014-07-02T21:05:59Z","pushed_at":"2014-07-21T21:42:14Z","git_url":"git://github.com/daptiv/Daptiv.Bus.git","ssh_url":"git@github.com:daptiv/Daptiv.Bus.git","clone_url":"https://github.com/daptiv/Daptiv.Bus.git","svn_url":"https://github.com/daptiv/Daptiv.Bus","homepage":null,"size":15524,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56"},"html":{"href":"https://github.com/daptiv/Daptiv.Bus/pull/56"},"issue":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/56"},"comments":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/daptiv/Daptiv.Bus/statuses/136124096e3d181398b5d37a4f9c26f3f29eac5d"}}}}