{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/comments/38948043","id":38948043,"diff_hunk":"@@ -42,5 +44,30 @@ public CollectionPropertyModel(string propertyName, List<PropertyModel> items)\n         {\n             this.Items = items;\n         }\n+\n+        internal static string GetItemDisplayPrefix(IEnumerable collection)\n+        {\n+            var elementType = ElementType(collection.GetType());\n+            if (elementType == null)\n+            {\n+                return \"item\";\n+            }\n+            return elementType.Name;\n+        }\n+\n+        private static Type ElementType(Type collectionType)\n+        {\n+            Debug.Assert(collectionType != null);\n+            Debug.Assert(typeof(IEnumerable).IsAssignableFrom(collectionType));\n+\n+            var stis = collectionType.FindInterfaces((m, c) => m.IsConstructedGenericType && m.GetGenericTypeDefinition() == typeof(IEnumerable<>), null);","path":"CSharp/BatchExplorer/Models/PropertyDisplayModel.cs","position":30,"original_position":30,"commit_id":"0c8daaa45aef8e3194c9b29b6996db6555f8f724","original_commit_id":"0c8daaa45aef8e3194c9b29b6996db6555f8f724","user":{"login":"matthchr","id":8798850,"avatar_url":"https://avatars.githubusercontent.com/u/8798850?v=3","gravatar_id":"","url":"https://api.github.com/users/matthchr","html_url":"https://github.com/matthchr","followers_url":"https://api.github.com/users/matthchr/followers","following_url":"https://api.github.com/users/matthchr/following{/other_user}","gists_url":"https://api.github.com/users/matthchr/gists{/gist_id}","starred_url":"https://api.github.com/users/matthchr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthchr/subscriptions","organizations_url":"https://api.github.com/users/matthchr/orgs","repos_url":"https://api.github.com/users/matthchr/repos","events_url":"https://api.github.com/users/matthchr/events{/privacy}","received_events_url":"https://api.github.com/users/matthchr/received_events","type":"User","site_admin":false},"body":"minor: Two stylistic things.\r\n1) what is stis?  Can we use a more descriptive variable name?\r\n2) Generally we've shied away from var, especially in cases where it's not clear what the variable type actually is -- in this case it's clear if you examine the code below (clearly stis must be a collection of some sort) but my personal preference is to spell the type out here.  If you don't want to do that (var is a religion =P) at least clarify the variable name.","created_at":"2015-09-08T16:35:48Z","updated_at":"2015-09-08T16:35:48Z","html_url":"https://github.com/Azure/azure-batch-samples/pull/49#discussion_r38948043","pull_request_url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/comments/38948043"},"html":{"href":"https://github.com/Azure/azure-batch-samples/pull/49#discussion_r38948043"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49","id":44317046,"html_url":"https://github.com/Azure/azure-batch-samples/pull/49","diff_url":"https://github.com/Azure/azure-batch-samples/pull/49.diff","patch_url":"https://github.com/Azure/azure-batch-samples/pull/49.patch","issue_url":"https://api.github.com/repos/Azure/azure-batch-samples/issues/49","number":49,"state":"open","locked":false,"title":"Use collection type for collection item prefix","user":{"login":"itowlson","id":865538,"avatar_url":"https://avatars.githubusercontent.com/u/865538?v=3","gravatar_id":"","url":"https://api.github.com/users/itowlson","html_url":"https://github.com/itowlson","followers_url":"https://api.github.com/users/itowlson/followers","following_url":"https://api.github.com/users/itowlson/following{/other_user}","gists_url":"https://api.github.com/users/itowlson/gists{/gist_id}","starred_url":"https://api.github.com/users/itowlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itowlson/subscriptions","organizations_url":"https://api.github.com/users/itowlson/orgs","repos_url":"https://api.github.com/users/itowlson/repos","events_url":"https://api.github.com/users/itowlson/events{/privacy}","received_events_url":"https://api.github.com/users/itowlson/received_events","type":"User","site_admin":false},"body":"For example, when displaying a collection of ResourceFiles, call them ResourceFile1, ResourceFile2, etc. instead of item1, item2, etc.","created_at":"2015-09-07T03:15:31Z","updated_at":"2015-09-08T16:35:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7cf37ad4e8ddef17cd4ad62d76438c375e74feac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-batch-samples/issues/49/comments","statuses_url":"https://api.github.com/repos/Azure/azure-batch-samples/statuses/0c8daaa45aef8e3194c9b29b6996db6555f8f724","head":{"label":"itowlson:collection-item-names","ref":"collection-item-names","sha":"0c8daaa45aef8e3194c9b29b6996db6555f8f724","user":{"login":"itowlson","id":865538,"avatar_url":"https://avatars.githubusercontent.com/u/865538?v=3","gravatar_id":"","url":"https://api.github.com/users/itowlson","html_url":"https://github.com/itowlson","followers_url":"https://api.github.com/users/itowlson/followers","following_url":"https://api.github.com/users/itowlson/following{/other_user}","gists_url":"https://api.github.com/users/itowlson/gists{/gist_id}","starred_url":"https://api.github.com/users/itowlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itowlson/subscriptions","organizations_url":"https://api.github.com/users/itowlson/orgs","repos_url":"https://api.github.com/users/itowlson/repos","events_url":"https://api.github.com/users/itowlson/events{/privacy}","received_events_url":"https://api.github.com/users/itowlson/received_events","type":"User","site_admin":false},"repo":{"id":34020582,"name":"azure-batch-samples","full_name":"itowlson/azure-batch-samples","owner":{"login":"itowlson","id":865538,"avatar_url":"https://avatars.githubusercontent.com/u/865538?v=3","gravatar_id":"","url":"https://api.github.com/users/itowlson","html_url":"https://github.com/itowlson","followers_url":"https://api.github.com/users/itowlson/followers","following_url":"https://api.github.com/users/itowlson/following{/other_user}","gists_url":"https://api.github.com/users/itowlson/gists{/gist_id}","starred_url":"https://api.github.com/users/itowlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itowlson/subscriptions","organizations_url":"https://api.github.com/users/itowlson/orgs","repos_url":"https://api.github.com/users/itowlson/repos","events_url":"https://api.github.com/users/itowlson/events{/privacy}","received_events_url":"https://api.github.com/users/itowlson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/itowlson/azure-batch-samples","description":"","fork":true,"url":"https://api.github.com/repos/itowlson/azure-batch-samples","forks_url":"https://api.github.com/repos/itowlson/azure-batch-samples/forks","keys_url":"https://api.github.com/repos/itowlson/azure-batch-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/itowlson/azure-batch-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/itowlson/azure-batch-samples/teams","hooks_url":"https://api.github.com/repos/itowlson/azure-batch-samples/hooks","issue_events_url":"https://api.github.com/repos/itowlson/azure-batch-samples/issues/events{/number}","events_url":"https://api.github.com/repos/itowlson/azure-batch-samples/events","assignees_url":"https://api.github.com/repos/itowlson/azure-batch-samples/assignees{/user}","branches_url":"https://api.github.com/repos/itowlson/azure-batch-samples/branches{/branch}","tags_url":"https://api.github.com/repos/itowlson/azure-batch-samples/tags","blobs_url":"https://api.github.com/repos/itowlson/azure-batch-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/itowlson/azure-batch-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/itowlson/azure-batch-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/itowlson/azure-batch-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/itowlson/azure-batch-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/itowlson/azure-batch-samples/languages","stargazers_url":"https://api.github.com/repos/itowlson/azure-batch-samples/stargazers","contributors_url":"https://api.github.com/repos/itowlson/azure-batch-samples/contributors","subscribers_url":"https://api.github.com/repos/itowlson/azure-batch-samples/subscribers","subscription_url":"https://api.github.com/repos/itowlson/azure-batch-samples/subscription","commits_url":"https://api.github.com/repos/itowlson/azure-batch-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/itowlson/azure-batch-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/itowlson/azure-batch-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/itowlson/azure-batch-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/itowlson/azure-batch-samples/contents/{+path}","compare_url":"https://api.github.com/repos/itowlson/azure-batch-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/itowlson/azure-batch-samples/merges","archive_url":"https://api.github.com/repos/itowlson/azure-batch-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/itowlson/azure-batch-samples/downloads","issues_url":"https://api.github.com/repos/itowlson/azure-batch-samples/issues{/number}","pulls_url":"https://api.github.com/repos/itowlson/azure-batch-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/itowlson/azure-batch-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/itowlson/azure-batch-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/itowlson/azure-batch-samples/labels{/name}","releases_url":"https://api.github.com/repos/itowlson/azure-batch-samples/releases{/id}","created_at":"2015-04-15T21:53:00Z","updated_at":"2015-04-16T20:14:46Z","pushed_at":"2015-09-07T03:52:30Z","git_url":"git://github.com/itowlson/azure-batch-samples.git","ssh_url":"git@github.com:itowlson/azure-batch-samples.git","clone_url":"https://github.com/itowlson/azure-batch-samples.git","svn_url":"https://github.com/itowlson/azure-batch-samples","homepage":null,"size":2067,"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":"Azure:master","ref":"master","sha":"bded6111389dc50ae1e5689f5eb05316297c70de","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","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":33752582,"name":"azure-batch-samples","full_name":"Azure/azure-batch-samples","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","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},"private":false,"html_url":"https://github.com/Azure/azure-batch-samples","description":"","fork":false,"url":"https://api.github.com/repos/Azure/azure-batch-samples","forks_url":"https://api.github.com/repos/Azure/azure-batch-samples/forks","keys_url":"https://api.github.com/repos/Azure/azure-batch-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-batch-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-batch-samples/teams","hooks_url":"https://api.github.com/repos/Azure/azure-batch-samples/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-batch-samples/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-batch-samples/events","assignees_url":"https://api.github.com/repos/Azure/azure-batch-samples/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-batch-samples/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-batch-samples/tags","blobs_url":"https://api.github.com/repos/Azure/azure-batch-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-batch-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-batch-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-batch-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-batch-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-batch-samples/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-batch-samples/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-batch-samples/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-batch-samples/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-batch-samples/subscription","commits_url":"https://api.github.com/repos/Azure/azure-batch-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-batch-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-batch-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-batch-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-batch-samples/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-batch-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-batch-samples/merges","archive_url":"https://api.github.com/repos/Azure/azure-batch-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-batch-samples/downloads","issues_url":"https://api.github.com/repos/Azure/azure-batch-samples/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-batch-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-batch-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-batch-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-batch-samples/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-batch-samples/releases{/id}","created_at":"2015-04-10T21:57:13Z","updated_at":"2015-09-02T20:31:36Z","pushed_at":"2015-09-07T23:30:18Z","git_url":"git://github.com/Azure/azure-batch-samples.git","ssh_url":"git@github.com:Azure/azure-batch-samples.git","clone_url":"https://github.com/Azure/azure-batch-samples.git","svn_url":"https://github.com/Azure/azure-batch-samples","homepage":null,"size":2294,"stargazers_count":13,"watchers_count":13,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":4,"forks":31,"open_issues":4,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49"},"html":{"href":"https://github.com/Azure/azure-batch-samples/pull/49"},"issue":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/issues/49"},"comments":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-batch-samples/statuses/0c8daaa45aef8e3194c9b29b6996db6555f8f724"}}}}