{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments/49559651","id":49559651,"diff_hunk":"@@ -0,0 +1,443 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Web;\n+using System.Web.Mvc;\n+using NuGetGallery.Areas.Admin.Models;\n+using NuGetGallery.Areas.Admin.ViewModels;\n+\n+namespace NuGetGallery.Areas.Admin.Controllers\n+{\n+    public class RequestController : AdminControllerBase\n+    {\n+        public ActionResult Create()\n+        {\n+            var admin = new AdminModel();\n+            var issueStatus = new IssueStatusModel();\n+            var createView = new CreateViewModel();\n+\n+            var allIssueStatuses = issueStatus.GetAllIssueStatuses();\n+            var allAdmins = admin.GetAllAdmins();\n+\n+            createView.AssignedToChoices = GetListOfAdmins(allAdmins, -1);\n+            createView.IssueStatusNameChoices = GetListOfIssueStatuses(allIssueStatuses, -1);\n+            createView.ReasonChoices = GetListOfReasons(string.Empty);\n+\n+            return View(createView);\n+        }\n+\n+        [HttpPost]\n+        public ActionResult Create(CreateViewModel createViewModel)\n+        {\n+            var issue = new IssueModel();\n+            var newIssue = createViewModel.Issue;\n+\n+            if (ModelState.IsValid)\n+            {\n+                newIssue.CreatedDate = DateTime.UtcNow;\n+                newIssue.AssignedTo = newIssue.AssignedTo ?? 0;\n+                newIssue.IssueStatus = newIssue.IssueStatus ?? 1;\n+                newIssue.Reason = String.IsNullOrEmpty(newIssue.Reason) ? \"Other\" : newIssue.Reason;\n+                issue.AddIssue(newIssue, GetLoggedInUser());\n+                return RedirectToAction(\"index\");\n+            }\n+            else\n+            {\n+                return View(newIssue);\n+            }\n+        }\n+  \n+        [HttpPost]\n+        public ActionResult Save([Bind(Prefix = \"item\")]IssueViewModel issueViewModel)\n+        {\n+            //Values required for updating the issue\n+            var issue = new IssueModel();\n+            var issueId = issueViewModel.Issue.Id;\n+\n+            var newAssignedTo = issueViewModel.AssignedTo ?? -1;\n+            var newIssueStatusName = issueViewModel.IssueStatusName ?? -1;\n+\n+            var currentIssue = issue.GetIssueById(issueId);\n+\n+            if (issue != null)\n+            {\n+                if (newAssignedTo != -1)\n+                {\n+                    currentIssue.AssignedTo = newAssignedTo;\n+                }\n+\n+                if (newIssueStatusName != -1)\n+                {\n+                    currentIssue.IssueStatus = newIssueStatusName;\n+                }\n+                issue.SaveChanges();\n+               \n+                issue.AddHistoryEntry(currentIssue, GetLoggedInUser());\n+            }\n+\n+            return RedirectToAction(\"index\", new","path":"src/NuGetGallery/Areas/Admin/Controllers/RequestController.cs","position":78,"original_position":78,"commit_id":"b7e57b7b315d222c7b39213621be2e5443495fd3","original_commit_id":"b7e57b7b315d222c7b39213621be2e5443495fd3","user":{"login":"maartenba","id":485230,"avatar_url":"https://avatars.githubusercontent.com/u/485230?v=3","gravatar_id":"","url":"https://api.github.com/users/maartenba","html_url":"https://github.com/maartenba","followers_url":"https://api.github.com/users/maartenba/followers","following_url":"https://api.github.com/users/maartenba/following{/other_user}","gists_url":"https://api.github.com/users/maartenba/gists{/gist_id}","starred_url":"https://api.github.com/users/maartenba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maartenba/subscriptions","organizations_url":"https://api.github.com/users/maartenba/orgs","repos_url":"https://api.github.com/users/maartenba/repos","events_url":"https://api.github.com/users/maartenba/events{/privacy}","received_events_url":"https://api.github.com/users/maartenba/received_events","type":"User","site_admin":false},"body":"**I**ndex (capital `I`) - several other occurrences as well.","created_at":"2016-01-13T07:52:33Z","updated_at":"2016-01-13T07:52:33Z","html_url":"https://github.com/NuGet/NuGetGallery/pull/2857#discussion_r49559651","pull_request_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments/49559651"},"html":{"href":"https://github.com/NuGet/NuGetGallery/pull/2857#discussion_r49559651"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857","id":55836486,"html_url":"https://github.com/NuGet/NuGetGallery/pull/2857","diff_url":"https://github.com/NuGet/NuGetGallery/pull/2857.diff","patch_url":"https://github.com/NuGet/NuGetGallery/pull/2857.patch","issue_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2857","number":2857,"state":"open","locked":false,"title":"Sreq","user":{"login":"RanjiniM","id":1399677,"avatar_url":"https://avatars.githubusercontent.com/u/1399677?v=3","gravatar_id":"","url":"https://api.github.com/users/RanjiniM","html_url":"https://github.com/RanjiniM","followers_url":"https://api.github.com/users/RanjiniM/followers","following_url":"https://api.github.com/users/RanjiniM/following{/other_user}","gists_url":"https://api.github.com/users/RanjiniM/gists{/gist_id}","starred_url":"https://api.github.com/users/RanjiniM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RanjiniM/subscriptions","organizations_url":"https://api.github.com/users/RanjiniM/orgs","repos_url":"https://api.github.com/users/RanjiniM/repos","events_url":"https://api.github.com/users/RanjiniM/events{/privacy}","received_events_url":"https://api.github.com/users/RanjiniM/received_events","type":"User","site_admin":false},"body":"First round of addressing code review comments. The following are pending still\r\n\r\n1. Move methods out of DbContext into Repository\r\n2. Write tests for the feature\r\n3. Mapping Admins table in Support Request DB to Admins in NuGetGallery\r\n","created_at":"2016-01-13T00:01:21Z","updated_at":"2016-01-13T07:52:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e22f350b22c07c8c7ff8fb222282ad38a2ee0d62","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2857/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/b7e57b7b315d222c7b39213621be2e5443495fd3","head":{"label":"NuGet:sreq","ref":"sreq","sha":"b7e57b7b315d222c7b39213621be2e5443495fd3","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2180736,"name":"NuGetGallery","full_name":"NuGet/NuGetGallery","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetGallery","description":"The NuGet Gallery","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetGallery","forks_url":"https://api.github.com/repos/NuGet/NuGetGallery/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetGallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetGallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetGallery/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetGallery/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetGallery/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetGallery/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetGallery/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetGallery/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetGallery/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetGallery/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetGallery/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetGallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetGallery/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetGallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetGallery/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetGallery/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetGallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetGallery/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetGallery/releases{/id}","created_at":"2011-08-09T17:57:32Z","updated_at":"2016-01-13T00:17:30Z","pushed_at":"2016-01-13T00:01:21Z","git_url":"git://github.com/NuGet/NuGetGallery.git","ssh_url":"git@github.com:NuGet/NuGetGallery.git","clone_url":"https://github.com/NuGet/NuGetGallery.git","svn_url":"https://github.com/NuGet/NuGetGallery","homepage":"http://www.nuget.org","size":38029,"stargazers_count":693,"watchers_count":693,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"open_issues_count":236,"forks":400,"open_issues":236,"watchers":693,"default_branch":"master"}},"base":{"label":"NuGet:master","ref":"master","sha":"1226789b82f92f9465df1397f62f350a483aeece","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2180736,"name":"NuGetGallery","full_name":"NuGet/NuGetGallery","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetGallery","description":"The NuGet Gallery","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetGallery","forks_url":"https://api.github.com/repos/NuGet/NuGetGallery/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetGallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetGallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetGallery/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetGallery/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetGallery/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetGallery/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetGallery/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetGallery/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetGallery/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetGallery/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetGallery/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetGallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetGallery/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetGallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetGallery/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetGallery/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetGallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetGallery/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetGallery/releases{/id}","created_at":"2011-08-09T17:57:32Z","updated_at":"2016-01-13T00:17:30Z","pushed_at":"2016-01-13T00:01:21Z","git_url":"git://github.com/NuGet/NuGetGallery.git","ssh_url":"git@github.com:NuGet/NuGetGallery.git","clone_url":"https://github.com/NuGet/NuGetGallery.git","svn_url":"https://github.com/NuGet/NuGetGallery","homepage":"http://www.nuget.org","size":38029,"stargazers_count":693,"watchers_count":693,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"open_issues_count":236,"forks":400,"open_issues":236,"watchers":693,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857"},"html":{"href":"https://github.com/NuGet/NuGetGallery/pull/2857"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2857"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/issues/2857/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/2857/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/b7e57b7b315d222c7b39213621be2e5443495fd3"}}}}