{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Routing/pulls/comments/26547668","id":26547668,"diff_hunk":"@@ -0,0 +1,71 @@\n+﻿// Copyright (c) Microsoft Open Technologies, Inc. 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.Collections.Generic;\n+\n+namespace Microsoft.AspNet.Routing\n+{\n+    /// <summary>\n+    /// Represents information about the route and virtual path that are the result of\n+    /// generating a URL with the ASP.NET routing middleware.\n+    /// </summary>\n+    public class VirtualPathData\n+    {\n+        private string _virtualPath;\n+        private readonly IDictionary<string, object> _dataToken;\n+\n+        /// <summary>\n+        ///  Initializes a new instance of the <see cref=\"VirtualPathData\"/> class.\n+        /// </summary>\n+        /// <param name=\"router\">The object that is used to generate the URL.</param>\n+        /// <param name=\"virtualPath\">The generated URL.</param>\n+        public VirtualPathData([NotNull] IRouter router, string virtualPath)\n+            : this(router, virtualPath, dataTokens: new RouteValueDictionary())\n+        {\n+        }\n+\n+        /// <summary>\n+        ///  Initializes a new instance of the <see cref=\"VirtualPathData\"/> class.\n+        /// </summary>\n+        /// <param name=\"router\">The object that is used to generate the URL.</param>\n+        /// <param name=\"virtualPath\">The generated URL.</param>\n+        /// <param name=\"dataTokens\">The collection of custom values.</param>\n+        public VirtualPathData(\n+            [NotNull] IRouter router,\n+            string virtualPath,\n+            IDictionary<string, object> dataTokens)\n+        {\n+            _dataToken = dataTokens ?? new RouteValueDictionary();","path":"src/Microsoft.AspNet.Routing/VirtualPathData.cs","position":38,"original_position":38,"commit_id":"d9fc84220d9ae0d7298d6ad28bec3a11f2dd9fa0","original_commit_id":"d9fc84220d9ae0d7298d6ad28bec3a11f2dd9fa0","user":{"login":"ianhong","id":2746184,"avatar_url":"https://avatars.githubusercontent.com/u/2746184?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhong","html_url":"https://github.com/ianhong","followers_url":"https://api.github.com/users/ianhong/followers","following_url":"https://api.github.com/users/ianhong/following{/other_user}","gists_url":"https://api.github.com/users/ianhong/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhong/subscriptions","organizations_url":"https://api.github.com/users/ianhong/orgs","repos_url":"https://api.github.com/users/ianhong/repos","events_url":"https://api.github.com/users/ianhong/events{/privacy}","received_events_url":"https://api.github.com/users/ianhong/received_events","type":"User","site_admin":false},"body":"Got it. Actually I like moving the responsbility of taking the snapshot to the constructor. It looks simpler than before. I'll also update the following code now can be pathData = new VirtualPathData(this, tempPath, DataToken), to take advantgae of this change. Let me know if you have any other thoughts. \r\n\r\n// In ttps://github.com/aspnet/Routing/blob/fix154/src/Microsoft.AspNet.Routing/Template/TemplateRoute.cs#L224-L230\r\n            pathData = new VirtualPathData(this, tempPath); \r\n224             if (DataTokens != null) \r\n225             { \r\n226                 foreach (var dataToken in DataTokens) \r\n227                 { \r\n228                     pathData.DataTokens.Add(dataToken.Key, dataToken.Value); \r\n229                 } \r\n230             } \r\n","created_at":"2015-03-17T03:49:01Z","updated_at":"2015-03-17T03:49:01Z","html_url":"https://github.com/aspnet/Routing/pull/158#discussion_r26547668","pull_request_url":"https://api.github.com/repos/aspnet/Routing/pulls/158","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Routing/pulls/comments/26547668"},"html":{"href":"https://github.com/aspnet/Routing/pull/158#discussion_r26547668"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Routing/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Routing/pulls/158","id":30949385,"html_url":"https://github.com/aspnet/Routing/pull/158","diff_url":"https://github.com/aspnet/Routing/pull/158.diff","patch_url":"https://github.com/aspnet/Routing/pull/158.patch","issue_url":"https://api.github.com/repos/aspnet/Routing/issues/158","number":158,"state":"open","locked":false,"title":"Add data tokens for link generation ","user":{"login":"ianhong","id":2746184,"avatar_url":"https://avatars.githubusercontent.com/u/2746184?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhong","html_url":"https://github.com/ianhong","followers_url":"https://api.github.com/users/ianhong/followers","following_url":"https://api.github.com/users/ianhong/following{/other_user}","gists_url":"https://api.github.com/users/ianhong/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhong/subscriptions","organizations_url":"https://api.github.com/users/ianhong/orgs","repos_url":"https://api.github.com/users/ianhong/repos","events_url":"https://api.github.com/users/ianhong/events{/privacy}","received_events_url":"https://api.github.com/users/ianhong/received_events","type":"User","site_admin":false},"body":"@harshgMSFT, @rynowak, and @Eilon \r\n\r\nThis is a PR for #154. Please take a look at this.\r\n\r\nThanks\r\n","created_at":"2015-03-11T14:44:30Z","updated_at":"2015-03-17T03:49:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08be4d32f1126cc90a235a34cf52c1e0c2226f97","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Routing/pulls/158/commits","review_comments_url":"https://api.github.com/repos/aspnet/Routing/pulls/158/comments","review_comment_url":"https://api.github.com/repos/aspnet/Routing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Routing/issues/158/comments","statuses_url":"https://api.github.com/repos/aspnet/Routing/statuses/d9fc84220d9ae0d7298d6ad28bec3a11f2dd9fa0","head":{"label":"aspnet:fix154","ref":"fix154","sha":"d9fc84220d9ae0d7298d6ad28bec3a11f2dd9fa0","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":16300347,"name":"Routing","full_name":"aspnet/Routing","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/Routing","description":"Middleware for routing requests to application logic.","fork":false,"url":"https://api.github.com/repos/aspnet/Routing","forks_url":"https://api.github.com/repos/aspnet/Routing/forks","keys_url":"https://api.github.com/repos/aspnet/Routing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Routing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Routing/teams","hooks_url":"https://api.github.com/repos/aspnet/Routing/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Routing/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Routing/events","assignees_url":"https://api.github.com/repos/aspnet/Routing/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Routing/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Routing/tags","blobs_url":"https://api.github.com/repos/aspnet/Routing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Routing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Routing/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Routing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Routing/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Routing/languages","stargazers_url":"https://api.github.com/repos/aspnet/Routing/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Routing/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Routing/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Routing/subscription","commits_url":"https://api.github.com/repos/aspnet/Routing/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Routing/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Routing/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Routing/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Routing/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Routing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Routing/merges","archive_url":"https://api.github.com/repos/aspnet/Routing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Routing/downloads","issues_url":"https://api.github.com/repos/aspnet/Routing/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Routing/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Routing/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Routing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Routing/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Routing/releases{/id}","created_at":"2014-01-28T02:50:39Z","updated_at":"2015-03-16T11:16:38Z","pushed_at":"2015-03-16T21:54:58Z","git_url":"git://github.com/aspnet/Routing.git","ssh_url":"git@github.com:aspnet/Routing.git","clone_url":"https://github.com/aspnet/Routing.git","svn_url":"https://github.com/aspnet/Routing","homepage":"","size":3127,"stargazers_count":103,"watchers_count":103,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":13,"forks":39,"open_issues":13,"watchers":103,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"fb08460770137cfb565b34e05febacfe98ecf21d","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":16300347,"name":"Routing","full_name":"aspnet/Routing","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/Routing","description":"Middleware for routing requests to application logic.","fork":false,"url":"https://api.github.com/repos/aspnet/Routing","forks_url":"https://api.github.com/repos/aspnet/Routing/forks","keys_url":"https://api.github.com/repos/aspnet/Routing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Routing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Routing/teams","hooks_url":"https://api.github.com/repos/aspnet/Routing/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Routing/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Routing/events","assignees_url":"https://api.github.com/repos/aspnet/Routing/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Routing/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Routing/tags","blobs_url":"https://api.github.com/repos/aspnet/Routing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Routing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Routing/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Routing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Routing/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Routing/languages","stargazers_url":"https://api.github.com/repos/aspnet/Routing/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Routing/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Routing/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Routing/subscription","commits_url":"https://api.github.com/repos/aspnet/Routing/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Routing/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Routing/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Routing/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Routing/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Routing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Routing/merges","archive_url":"https://api.github.com/repos/aspnet/Routing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Routing/downloads","issues_url":"https://api.github.com/repos/aspnet/Routing/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Routing/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Routing/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Routing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Routing/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Routing/releases{/id}","created_at":"2014-01-28T02:50:39Z","updated_at":"2015-03-16T11:16:38Z","pushed_at":"2015-03-16T21:54:58Z","git_url":"git://github.com/aspnet/Routing.git","ssh_url":"git@github.com:aspnet/Routing.git","clone_url":"https://github.com/aspnet/Routing.git","svn_url":"https://github.com/aspnet/Routing","homepage":"","size":3127,"stargazers_count":103,"watchers_count":103,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":13,"forks":39,"open_issues":13,"watchers":103,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Routing/pulls/158"},"html":{"href":"https://github.com/aspnet/Routing/pull/158"},"issue":{"href":"https://api.github.com/repos/aspnet/Routing/issues/158"},"comments":{"href":"https://api.github.com/repos/aspnet/Routing/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Routing/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Routing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Routing/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Routing/statuses/d9fc84220d9ae0d7298d6ad28bec3a11f2dd9fa0"}}}}