{"action":"created","comment":{"url":"https://api.github.com/repos/Readify/Neo4jClient/pulls/comments/35700087","id":35700087,"diff_hunk":"@@ -240,6 +240,61 @@ public virtual void Connect()\n             });\r\n         }\r\n \r\n+        public virtual Task ConnectAsync()\r\n+        {\r\n+            var stopwatch = new Stopwatch();\r\n+            stopwatch.Start();\r\n+\r\n+            return SendHttpRequestAsync(HttpGet(\"\"), HttpStatusCode.OK).Then<HttpResponseMessage>(response =>\r\n+            {\r\n+                var result = response.Content.ReadAsJson<RootApiResponse>(JsonConverters, JsonContractResolver);\r\n+\r\n+                var rootUriWithoutUserInfo = RootUri;\r\n+                if (!string.IsNullOrEmpty(rootUriWithoutUserInfo.UserInfo))\r\n+                    rootUriWithoutUserInfo = new UriBuilder(RootUri.AbsoluteUri) { UserName = \"\", Password = \"\" }.Uri;\r\n+                var baseUriLengthToTrim = rootUriWithoutUserInfo.AbsoluteUri.Length;\r\n+\r\n+                RootApiResponse = result;\r\n+                RootApiResponse.Batch = RootApiResponse.Batch.Substring(baseUriLengthToTrim);\r\n+                RootApiResponse.Node = RootApiResponse.Node.Substring(baseUriLengthToTrim);\r\n+                RootApiResponse.NodeIndex = RootApiResponse.NodeIndex.Substring(baseUriLengthToTrim);\r\n+                RootApiResponse.Relationship = \"/relationship\"; //Doesn't come in on the Service Root\r\n+                RootApiResponse.RelationshipIndex = RootApiResponse.RelationshipIndex.Substring(baseUriLengthToTrim);\r\n+                RootApiResponse.ExtensionsInfo = RootApiResponse.ExtensionsInfo.Substring(baseUriLengthToTrim);\r\n+\r\n+                if (RootApiResponse.Extensions != null && RootApiResponse.Extensions.GremlinPlugin != null)\r\n+                {\r\n+                    RootApiResponse.Extensions.GremlinPlugin.ExecuteScript =\r\n+                        RootApiResponse.Extensions.GremlinPlugin.ExecuteScript.Substring(baseUriLengthToTrim);\r\n+                }\r\n+\r\n+                if (RootApiResponse.Cypher != null)\r\n+                {\r\n+                    RootApiResponse.Cypher =\r\n+                        RootApiResponse.Cypher.Substring(baseUriLengthToTrim);\r\n+                }\r\n+\r\n+                rootNode = string.IsNullOrEmpty(RootApiResponse.ReferenceNode)\r\n+                    ? null\r\n+                    : new RootNode(long.Parse(GetLastPathSegment(RootApiResponse.ReferenceNode)), this);\r\n+\r\n+                // http://blog.neo4j.org/2012/04/streaming-rest-api-interview-with.html\r\n+                jsonStreamingAvailable = RootApiResponse.Version >= new Version(1, 8);\r\n+\r\n+                if (RootApiResponse.Version < new Version(2, 0))\r\n+                    cypherCapabilities = CypherCapabilities.Cypher19;\r\n+\r\n+                stopwatch.Stop();\r\n+                OnOperationCompleted(new OperationCompletedEventArgs\r","path":"Neo4jClient/GraphClient.cs","position":49,"original_position":49,"commit_id":"4fc1ec4340713bef0ead0b19afc4abbfe191fb67","original_commit_id":"4fc1ec4340713bef0ead0b19afc4abbfe191fb67","user":{"login":"tugberkugurlu","id":328122,"avatar_url":"https://avatars.githubusercontent.com/u/328122?v=3","gravatar_id":"","url":"https://api.github.com/users/tugberkugurlu","html_url":"https://github.com/tugberkugurlu","followers_url":"https://api.github.com/users/tugberkugurlu/followers","following_url":"https://api.github.com/users/tugberkugurlu/following{/other_user}","gists_url":"https://api.github.com/users/tugberkugurlu/gists{/gist_id}","starred_url":"https://api.github.com/users/tugberkugurlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tugberkugurlu/subscriptions","organizations_url":"https://api.github.com/users/tugberkugurlu/orgs","repos_url":"https://api.github.com/users/tugberkugurlu/repos","events_url":"https://api.github.com/users/tugberkugurlu/events{/privacy}","received_events_url":"https://api.github.com/users/tugberkugurlu/received_events","type":"User","site_admin":false},"body":"Is `OnOperationCompleted` supposed to run on success case or in every case?","created_at":"2015-07-28T20:58:22Z","updated_at":"2015-07-28T20:58:22Z","html_url":"https://github.com/Readify/Neo4jClient/pull/102#discussion_r35700087","pull_request_url":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/Readify/Neo4jClient/pulls/comments/35700087"},"html":{"href":"https://github.com/Readify/Neo4jClient/pull/102#discussion_r35700087"},"pull_request":{"href":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102","id":41059286,"html_url":"https://github.com/Readify/Neo4jClient/pull/102","diff_url":"https://github.com/Readify/Neo4jClient/pull/102.diff","patch_url":"https://github.com/Readify/Neo4jClient/pull/102.patch","issue_url":"https://api.github.com/repos/Readify/Neo4jClient/issues/102","number":102,"state":"open","locked":false,"title":"Introduced GraphClient.ConnectAsync","user":{"login":"tugberkugurlu","id":328122,"avatar_url":"https://avatars.githubusercontent.com/u/328122?v=3","gravatar_id":"","url":"https://api.github.com/users/tugberkugurlu","html_url":"https://github.com/tugberkugurlu","followers_url":"https://api.github.com/users/tugberkugurlu/followers","following_url":"https://api.github.com/users/tugberkugurlu/following{/other_user}","gists_url":"https://api.github.com/users/tugberkugurlu/gists{/gist_id}","starred_url":"https://api.github.com/users/tugberkugurlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tugberkugurlu/subscriptions","organizations_url":"https://api.github.com/users/tugberkugurlu/orgs","repos_url":"https://api.github.com/users/tugberkugurlu/repos","events_url":"https://api.github.com/users/tugberkugurlu/events{/privacy}","received_events_url":"https://api.github.com/users/tugberkugurlu/received_events","type":"User","site_admin":false},"body":"Fixes #101.\r\n\r\n> **NOTE:** this is very raw at the moment and not ready to be merged in. Opening up this PR to discuss some questions.\r\n\r\nIntroduced `ConnectAsync` on `GraphClient` which is the asynchronous version of the exsiting `Connect` method.\r\n\r\n - [x] Introduce TaskHelpers.Sources library to easily handle raw TPL APIs.\r\n - [x] Implement `ConnectAsync` without any refactoring.\r\n - [x] Add `ReadAsJsonAsync<T>` extension methods on `HttpContent`.\r\n - [ ] Implement reading the response stream asynchronously in `ConnectAsync`.\r\n - [ ] Add tests.\r\n - [ ] Refactor stuff in `GraphClient` (mainly share common stuff between `Connect` and `ConnectAsync`).\r\n - [ ] Rebase and clean up commits.","created_at":"2015-07-28T20:54:44Z","updated_at":"2015-07-28T20:58:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0898c3d28e7e4ed2163f3b8735a1a7f30d57142b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102/commits","review_comments_url":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102/comments","review_comment_url":"https://api.github.com/repos/Readify/Neo4jClient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Readify/Neo4jClient/issues/102/comments","statuses_url":"https://api.github.com/repos/Readify/Neo4jClient/statuses/4fc1ec4340713bef0ead0b19afc4abbfe191fb67","head":{"label":"tugberkugurlu:connect-async","ref":"connect-async","sha":"4fc1ec4340713bef0ead0b19afc4abbfe191fb67","user":{"login":"tugberkugurlu","id":328122,"avatar_url":"https://avatars.githubusercontent.com/u/328122?v=3","gravatar_id":"","url":"https://api.github.com/users/tugberkugurlu","html_url":"https://github.com/tugberkugurlu","followers_url":"https://api.github.com/users/tugberkugurlu/followers","following_url":"https://api.github.com/users/tugberkugurlu/following{/other_user}","gists_url":"https://api.github.com/users/tugberkugurlu/gists{/gist_id}","starred_url":"https://api.github.com/users/tugberkugurlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tugberkugurlu/subscriptions","organizations_url":"https://api.github.com/users/tugberkugurlu/orgs","repos_url":"https://api.github.com/users/tugberkugurlu/repos","events_url":"https://api.github.com/users/tugberkugurlu/events{/privacy}","received_events_url":"https://api.github.com/users/tugberkugurlu/received_events","type":"User","site_admin":false},"repo":{"id":39719148,"name":"Neo4jClient","full_name":"tugberkugurlu/Neo4jClient","owner":{"login":"tugberkugurlu","id":328122,"avatar_url":"https://avatars.githubusercontent.com/u/328122?v=3","gravatar_id":"","url":"https://api.github.com/users/tugberkugurlu","html_url":"https://github.com/tugberkugurlu","followers_url":"https://api.github.com/users/tugberkugurlu/followers","following_url":"https://api.github.com/users/tugberkugurlu/following{/other_user}","gists_url":"https://api.github.com/users/tugberkugurlu/gists{/gist_id}","starred_url":"https://api.github.com/users/tugberkugurlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tugberkugurlu/subscriptions","organizations_url":"https://api.github.com/users/tugberkugurlu/orgs","repos_url":"https://api.github.com/users/tugberkugurlu/repos","events_url":"https://api.github.com/users/tugberkugurlu/events{/privacy}","received_events_url":"https://api.github.com/users/tugberkugurlu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tugberkugurlu/Neo4jClient","description":".NET client binding for Neo4j","fork":true,"url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient","forks_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/forks","keys_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/teams","hooks_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/hooks","issue_events_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/issues/events{/number}","events_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/events","assignees_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/assignees{/user}","branches_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/branches{/branch}","tags_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/tags","blobs_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/git/refs{/sha}","trees_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/statuses/{sha}","languages_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/languages","stargazers_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/stargazers","contributors_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/contributors","subscribers_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/subscribers","subscription_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/subscription","commits_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/commits{/sha}","git_commits_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/git/commits{/sha}","comments_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/comments{/number}","issue_comment_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/issues/comments{/number}","contents_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/contents/{+path}","compare_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/merges","archive_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/downloads","issues_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/issues{/number}","pulls_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/pulls{/number}","milestones_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/milestones{/number}","notifications_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/labels{/name}","releases_url":"https://api.github.com/repos/tugberkugurlu/Neo4jClient/releases{/id}","created_at":"2015-07-26T08:38:13Z","updated_at":"2015-07-26T08:38:14Z","pushed_at":"2015-07-28T20:43:30Z","git_url":"git://github.com/tugberkugurlu/Neo4jClient.git","ssh_url":"git@github.com:tugberkugurlu/Neo4jClient.git","clone_url":"https://github.com/tugberkugurlu/Neo4jClient.git","svn_url":"https://github.com/tugberkugurlu/Neo4jClient","homepage":"https://www.nuget.org/packages/Neo4jClient","size":28431,"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":"master"}},"base":{"label":"Readify:master","ref":"master","sha":"3eb9daa023743ff9e1a7a9c2052dcd1fa2f00c38","user":{"login":"Readify","id":216220,"avatar_url":"https://avatars.githubusercontent.com/u/216220?v=3","gravatar_id":"","url":"https://api.github.com/users/Readify","html_url":"https://github.com/Readify","followers_url":"https://api.github.com/users/Readify/followers","following_url":"https://api.github.com/users/Readify/following{/other_user}","gists_url":"https://api.github.com/users/Readify/gists{/gist_id}","starred_url":"https://api.github.com/users/Readify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Readify/subscriptions","organizations_url":"https://api.github.com/users/Readify/orgs","repos_url":"https://api.github.com/users/Readify/repos","events_url":"https://api.github.com/users/Readify/events{/privacy}","received_events_url":"https://api.github.com/users/Readify/received_events","type":"Organization","site_admin":false},"repo":{"id":14532176,"name":"Neo4jClient","full_name":"Readify/Neo4jClient","owner":{"login":"Readify","id":216220,"avatar_url":"https://avatars.githubusercontent.com/u/216220?v=3","gravatar_id":"","url":"https://api.github.com/users/Readify","html_url":"https://github.com/Readify","followers_url":"https://api.github.com/users/Readify/followers","following_url":"https://api.github.com/users/Readify/following{/other_user}","gists_url":"https://api.github.com/users/Readify/gists{/gist_id}","starred_url":"https://api.github.com/users/Readify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Readify/subscriptions","organizations_url":"https://api.github.com/users/Readify/orgs","repos_url":"https://api.github.com/users/Readify/repos","events_url":"https://api.github.com/users/Readify/events{/privacy}","received_events_url":"https://api.github.com/users/Readify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Readify/Neo4jClient","description":".NET client binding for Neo4j","fork":false,"url":"https://api.github.com/repos/Readify/Neo4jClient","forks_url":"https://api.github.com/repos/Readify/Neo4jClient/forks","keys_url":"https://api.github.com/repos/Readify/Neo4jClient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Readify/Neo4jClient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Readify/Neo4jClient/teams","hooks_url":"https://api.github.com/repos/Readify/Neo4jClient/hooks","issue_events_url":"https://api.github.com/repos/Readify/Neo4jClient/issues/events{/number}","events_url":"https://api.github.com/repos/Readify/Neo4jClient/events","assignees_url":"https://api.github.com/repos/Readify/Neo4jClient/assignees{/user}","branches_url":"https://api.github.com/repos/Readify/Neo4jClient/branches{/branch}","tags_url":"https://api.github.com/repos/Readify/Neo4jClient/tags","blobs_url":"https://api.github.com/repos/Readify/Neo4jClient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Readify/Neo4jClient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Readify/Neo4jClient/git/refs{/sha}","trees_url":"https://api.github.com/repos/Readify/Neo4jClient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Readify/Neo4jClient/statuses/{sha}","languages_url":"https://api.github.com/repos/Readify/Neo4jClient/languages","stargazers_url":"https://api.github.com/repos/Readify/Neo4jClient/stargazers","contributors_url":"https://api.github.com/repos/Readify/Neo4jClient/contributors","subscribers_url":"https://api.github.com/repos/Readify/Neo4jClient/subscribers","subscription_url":"https://api.github.com/repos/Readify/Neo4jClient/subscription","commits_url":"https://api.github.com/repos/Readify/Neo4jClient/commits{/sha}","git_commits_url":"https://api.github.com/repos/Readify/Neo4jClient/git/commits{/sha}","comments_url":"https://api.github.com/repos/Readify/Neo4jClient/comments{/number}","issue_comment_url":"https://api.github.com/repos/Readify/Neo4jClient/issues/comments{/number}","contents_url":"https://api.github.com/repos/Readify/Neo4jClient/contents/{+path}","compare_url":"https://api.github.com/repos/Readify/Neo4jClient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Readify/Neo4jClient/merges","archive_url":"https://api.github.com/repos/Readify/Neo4jClient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Readify/Neo4jClient/downloads","issues_url":"https://api.github.com/repos/Readify/Neo4jClient/issues{/number}","pulls_url":"https://api.github.com/repos/Readify/Neo4jClient/pulls{/number}","milestones_url":"https://api.github.com/repos/Readify/Neo4jClient/milestones{/number}","notifications_url":"https://api.github.com/repos/Readify/Neo4jClient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Readify/Neo4jClient/labels{/name}","releases_url":"https://api.github.com/repos/Readify/Neo4jClient/releases{/id}","created_at":"2013-11-19T17:33:28Z","updated_at":"2015-07-28T20:52:21Z","pushed_at":"2015-07-28T20:54:44Z","git_url":"git://github.com/Readify/Neo4jClient.git","ssh_url":"git@github.com:Readify/Neo4jClient.git","clone_url":"https://github.com/Readify/Neo4jClient.git","svn_url":"https://github.com/Readify/Neo4jClient","homepage":"https://www.nuget.org/packages/Neo4jClient","size":28431,"stargazers_count":104,"watchers_count":104,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":49,"forks":72,"open_issues":49,"watchers":104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102"},"html":{"href":"https://github.com/Readify/Neo4jClient/pull/102"},"issue":{"href":"https://api.github.com/repos/Readify/Neo4jClient/issues/102"},"comments":{"href":"https://api.github.com/repos/Readify/Neo4jClient/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/Readify/Neo4jClient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Readify/Neo4jClient/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/Readify/Neo4jClient/statuses/4fc1ec4340713bef0ead0b19afc4abbfe191fb67"}}}}