{"action":"created","comment":{"url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/comments/39028955","id":39028955,"diff_hunk":"@@ -0,0 +1,232 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace University.Nikita\n+{\n+    internal class Schedule : ISchedule\n+    {\n+        private Dictionary<DateTime, List<ScheduleItem>> _items;\n+\n+        public Schedule(Dictionary<DateTime, List<ScheduleItem>> items)\n+        {\n+            _items = items;\n+        }\n+\n+\n+        public IReadOnlyDictionary<string, IReadOnlyList<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>>GetByDay(DateTime day)\n+        {\n+            var perRoomDict = new Dictionary<string, IReadOnlyList<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>>();\n+            foreach (var pair in _items)\n+            {\n+                if (pair.Key != day) continue;\n+                foreach (var item in pair.Value)\n+                {\n+                    if (perRoomDict.ContainsKey(item.Room.Id))\n+                    {\n+                        var tuplesList = new List<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>();\n+                        tuplesList.AddRange(perRoomDict.SelectMany(list => list.Value));\n+                        tuplesList.Add(\n+                            new Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>(\n+                                ScheduleItem.DateLessonTimes[item.Order],\n+                                item.Teachers.Select(t => t.FullName).ToList(),\n+                                item.Groups.Select(g => g.ID).ToList()));\n+                        perRoomDict[item.Room.Id] = tuplesList;\n+                    }\n+                    else\n+                    {\n+                        var tuplesList = new List<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>\n+                        {\n+                            new Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>(\n+                                ScheduleItem.DateLessonTimes[item.Order],\n+                                item.Teachers.Select(t => t.FullName).ToList(),\n+                                item.Groups.Select(g => g.ID).ToList())\n+                        };\n+                        perRoomDict[item.Room.Id] = tuplesList;\n+                    }\n+                }\n+            }\n+            return perRoomDict;\n+        }\n+\n+        public IReadOnlyDictionary <DateTime, IReadOnlyDictionary <string, IReadOnlyList<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>>> GetAll()\n+        {\n+            var perDateDict = new Dictionary<DateTime, IReadOnlyDictionary <string, IReadOnlyList<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>>>();\n+            foreach (var pair in _items)\n+            {\n+                var perRoomDict = new Dictionary<string, IReadOnlyList<Tuple<DateTime, IReadOnlyList<string>, IReadOnlyList<string>>>>();\n+                foreach (var item in pair.Value)\n+                {\n+                    if (perRoomDict.ContainsKey(item.Room.Id))","path":"University/Nikita/Schedule.cs","position":62,"original_position":62,"commit_id":"278cbe4d43eba608d713930f6ecbc5cb803ddd9d","original_commit_id":"278cbe4d43eba608d713930f6ecbc5cb803ddd9d","user":{"login":"olga-jane","id":8179067,"avatar_url":"https://avatars.githubusercontent.com/u/8179067?v=3","gravatar_id":"","url":"https://api.github.com/users/olga-jane","html_url":"https://github.com/olga-jane","followers_url":"https://api.github.com/users/olga-jane/followers","following_url":"https://api.github.com/users/olga-jane/following{/other_user}","gists_url":"https://api.github.com/users/olga-jane/gists{/gist_id}","starred_url":"https://api.github.com/users/olga-jane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olga-jane/subscriptions","organizations_url":"https://api.github.com/users/olga-jane/orgs","repos_url":"https://api.github.com/users/olga-jane/repos","events_url":"https://api.github.com/users/olga-jane/events{/privacy}","received_events_url":"https://api.github.com/users/olga-jane/received_events","type":"User","site_admin":false},"body":"I think this code can be simplified","created_at":"2015-09-09T10:50:13Z","updated_at":"2015-09-09T10:50:13Z","html_url":"https://github.com/olga-jane/tasks_cs1/pull/29#discussion_r39028955","pull_request_url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/comments/39028955"},"html":{"href":"https://github.com/olga-jane/tasks_cs1/pull/29#discussion_r39028955"},"pull_request":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29","id":44454541,"html_url":"https://github.com/olga-jane/tasks_cs1/pull/29","diff_url":"https://github.com/olga-jane/tasks_cs1/pull/29.diff","patch_url":"https://github.com/olga-jane/tasks_cs1/pull/29.patch","issue_url":"https://api.github.com/repos/olga-jane/tasks_cs1/issues/29","number":29,"state":"open","locked":false,"title":"04.09.2015(University)","user":{"login":"imnikoo","id":12213000,"avatar_url":"https://avatars.githubusercontent.com/u/12213000?v=3","gravatar_id":"","url":"https://api.github.com/users/imnikoo","html_url":"https://github.com/imnikoo","followers_url":"https://api.github.com/users/imnikoo/followers","following_url":"https://api.github.com/users/imnikoo/following{/other_user}","gists_url":"https://api.github.com/users/imnikoo/gists{/gist_id}","starred_url":"https://api.github.com/users/imnikoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imnikoo/subscriptions","organizations_url":"https://api.github.com/users/imnikoo/orgs","repos_url":"https://api.github.com/users/imnikoo/repos","events_url":"https://api.github.com/users/imnikoo/events{/privacy}","received_events_url":"https://api.github.com/users/imnikoo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-08T16:37:33Z","updated_at":"2015-09-09T10:50:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"774a3ebd75f67d1fa2fd36c6851c91d4912d0c91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29/commits","review_comments_url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29/comments","review_comment_url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/olga-jane/tasks_cs1/issues/29/comments","statuses_url":"https://api.github.com/repos/olga-jane/tasks_cs1/statuses/278cbe4d43eba608d713930f6ecbc5cb803ddd9d","head":{"label":"imnikoo:04.09.2015","ref":"04.09.2015","sha":"278cbe4d43eba608d713930f6ecbc5cb803ddd9d","user":{"login":"imnikoo","id":12213000,"avatar_url":"https://avatars.githubusercontent.com/u/12213000?v=3","gravatar_id":"","url":"https://api.github.com/users/imnikoo","html_url":"https://github.com/imnikoo","followers_url":"https://api.github.com/users/imnikoo/followers","following_url":"https://api.github.com/users/imnikoo/following{/other_user}","gists_url":"https://api.github.com/users/imnikoo/gists{/gist_id}","starred_url":"https://api.github.com/users/imnikoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imnikoo/subscriptions","organizations_url":"https://api.github.com/users/imnikoo/orgs","repos_url":"https://api.github.com/users/imnikoo/repos","events_url":"https://api.github.com/users/imnikoo/events{/privacy}","received_events_url":"https://api.github.com/users/imnikoo/received_events","type":"User","site_admin":false},"repo":{"id":40170344,"name":"tasks_cs1","full_name":"imnikoo/tasks_cs1","owner":{"login":"imnikoo","id":12213000,"avatar_url":"https://avatars.githubusercontent.com/u/12213000?v=3","gravatar_id":"","url":"https://api.github.com/users/imnikoo","html_url":"https://github.com/imnikoo","followers_url":"https://api.github.com/users/imnikoo/followers","following_url":"https://api.github.com/users/imnikoo/following{/other_user}","gists_url":"https://api.github.com/users/imnikoo/gists{/gist_id}","starred_url":"https://api.github.com/users/imnikoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imnikoo/subscriptions","organizations_url":"https://api.github.com/users/imnikoo/orgs","repos_url":"https://api.github.com/users/imnikoo/repos","events_url":"https://api.github.com/users/imnikoo/events{/privacy}","received_events_url":"https://api.github.com/users/imnikoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imnikoo/tasks_cs1","description":"","fork":true,"url":"https://api.github.com/repos/imnikoo/tasks_cs1","forks_url":"https://api.github.com/repos/imnikoo/tasks_cs1/forks","keys_url":"https://api.github.com/repos/imnikoo/tasks_cs1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imnikoo/tasks_cs1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imnikoo/tasks_cs1/teams","hooks_url":"https://api.github.com/repos/imnikoo/tasks_cs1/hooks","issue_events_url":"https://api.github.com/repos/imnikoo/tasks_cs1/issues/events{/number}","events_url":"https://api.github.com/repos/imnikoo/tasks_cs1/events","assignees_url":"https://api.github.com/repos/imnikoo/tasks_cs1/assignees{/user}","branches_url":"https://api.github.com/repos/imnikoo/tasks_cs1/branches{/branch}","tags_url":"https://api.github.com/repos/imnikoo/tasks_cs1/tags","blobs_url":"https://api.github.com/repos/imnikoo/tasks_cs1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imnikoo/tasks_cs1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imnikoo/tasks_cs1/git/refs{/sha}","trees_url":"https://api.github.com/repos/imnikoo/tasks_cs1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imnikoo/tasks_cs1/statuses/{sha}","languages_url":"https://api.github.com/repos/imnikoo/tasks_cs1/languages","stargazers_url":"https://api.github.com/repos/imnikoo/tasks_cs1/stargazers","contributors_url":"https://api.github.com/repos/imnikoo/tasks_cs1/contributors","subscribers_url":"https://api.github.com/repos/imnikoo/tasks_cs1/subscribers","subscription_url":"https://api.github.com/repos/imnikoo/tasks_cs1/subscription","commits_url":"https://api.github.com/repos/imnikoo/tasks_cs1/commits{/sha}","git_commits_url":"https://api.github.com/repos/imnikoo/tasks_cs1/git/commits{/sha}","comments_url":"https://api.github.com/repos/imnikoo/tasks_cs1/comments{/number}","issue_comment_url":"https://api.github.com/repos/imnikoo/tasks_cs1/issues/comments{/number}","contents_url":"https://api.github.com/repos/imnikoo/tasks_cs1/contents/{+path}","compare_url":"https://api.github.com/repos/imnikoo/tasks_cs1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imnikoo/tasks_cs1/merges","archive_url":"https://api.github.com/repos/imnikoo/tasks_cs1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imnikoo/tasks_cs1/downloads","issues_url":"https://api.github.com/repos/imnikoo/tasks_cs1/issues{/number}","pulls_url":"https://api.github.com/repos/imnikoo/tasks_cs1/pulls{/number}","milestones_url":"https://api.github.com/repos/imnikoo/tasks_cs1/milestones{/number}","notifications_url":"https://api.github.com/repos/imnikoo/tasks_cs1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imnikoo/tasks_cs1/labels{/name}","releases_url":"https://api.github.com/repos/imnikoo/tasks_cs1/releases{/id}","created_at":"2015-08-04T07:39:10Z","updated_at":"2015-08-04T07:52:47Z","pushed_at":"2015-09-08T16:36:34Z","git_url":"git://github.com/imnikoo/tasks_cs1.git","ssh_url":"git@github.com:imnikoo/tasks_cs1.git","clone_url":"https://github.com/imnikoo/tasks_cs1.git","svn_url":"https://github.com/imnikoo/tasks_cs1","homepage":"","size":520,"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":"olga-jane:master","ref":"master","sha":"7f8856d2c1762852fadbc4e87c64e383e0da2089","user":{"login":"olga-jane","id":8179067,"avatar_url":"https://avatars.githubusercontent.com/u/8179067?v=3","gravatar_id":"","url":"https://api.github.com/users/olga-jane","html_url":"https://github.com/olga-jane","followers_url":"https://api.github.com/users/olga-jane/followers","following_url":"https://api.github.com/users/olga-jane/following{/other_user}","gists_url":"https://api.github.com/users/olga-jane/gists{/gist_id}","starred_url":"https://api.github.com/users/olga-jane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olga-jane/subscriptions","organizations_url":"https://api.github.com/users/olga-jane/orgs","repos_url":"https://api.github.com/users/olga-jane/repos","events_url":"https://api.github.com/users/olga-jane/events{/privacy}","received_events_url":"https://api.github.com/users/olga-jane/received_events","type":"User","site_admin":false},"repo":{"id":40169547,"name":"tasks_cs1","full_name":"olga-jane/tasks_cs1","owner":{"login":"olga-jane","id":8179067,"avatar_url":"https://avatars.githubusercontent.com/u/8179067?v=3","gravatar_id":"","url":"https://api.github.com/users/olga-jane","html_url":"https://github.com/olga-jane","followers_url":"https://api.github.com/users/olga-jane/followers","following_url":"https://api.github.com/users/olga-jane/following{/other_user}","gists_url":"https://api.github.com/users/olga-jane/gists{/gist_id}","starred_url":"https://api.github.com/users/olga-jane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olga-jane/subscriptions","organizations_url":"https://api.github.com/users/olga-jane/orgs","repos_url":"https://api.github.com/users/olga-jane/repos","events_url":"https://api.github.com/users/olga-jane/events{/privacy}","received_events_url":"https://api.github.com/users/olga-jane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olga-jane/tasks_cs1","description":"","fork":false,"url":"https://api.github.com/repos/olga-jane/tasks_cs1","forks_url":"https://api.github.com/repos/olga-jane/tasks_cs1/forks","keys_url":"https://api.github.com/repos/olga-jane/tasks_cs1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olga-jane/tasks_cs1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olga-jane/tasks_cs1/teams","hooks_url":"https://api.github.com/repos/olga-jane/tasks_cs1/hooks","issue_events_url":"https://api.github.com/repos/olga-jane/tasks_cs1/issues/events{/number}","events_url":"https://api.github.com/repos/olga-jane/tasks_cs1/events","assignees_url":"https://api.github.com/repos/olga-jane/tasks_cs1/assignees{/user}","branches_url":"https://api.github.com/repos/olga-jane/tasks_cs1/branches{/branch}","tags_url":"https://api.github.com/repos/olga-jane/tasks_cs1/tags","blobs_url":"https://api.github.com/repos/olga-jane/tasks_cs1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olga-jane/tasks_cs1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olga-jane/tasks_cs1/git/refs{/sha}","trees_url":"https://api.github.com/repos/olga-jane/tasks_cs1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olga-jane/tasks_cs1/statuses/{sha}","languages_url":"https://api.github.com/repos/olga-jane/tasks_cs1/languages","stargazers_url":"https://api.github.com/repos/olga-jane/tasks_cs1/stargazers","contributors_url":"https://api.github.com/repos/olga-jane/tasks_cs1/contributors","subscribers_url":"https://api.github.com/repos/olga-jane/tasks_cs1/subscribers","subscription_url":"https://api.github.com/repos/olga-jane/tasks_cs1/subscription","commits_url":"https://api.github.com/repos/olga-jane/tasks_cs1/commits{/sha}","git_commits_url":"https://api.github.com/repos/olga-jane/tasks_cs1/git/commits{/sha}","comments_url":"https://api.github.com/repos/olga-jane/tasks_cs1/comments{/number}","issue_comment_url":"https://api.github.com/repos/olga-jane/tasks_cs1/issues/comments{/number}","contents_url":"https://api.github.com/repos/olga-jane/tasks_cs1/contents/{+path}","compare_url":"https://api.github.com/repos/olga-jane/tasks_cs1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olga-jane/tasks_cs1/merges","archive_url":"https://api.github.com/repos/olga-jane/tasks_cs1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olga-jane/tasks_cs1/downloads","issues_url":"https://api.github.com/repos/olga-jane/tasks_cs1/issues{/number}","pulls_url":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls{/number}","milestones_url":"https://api.github.com/repos/olga-jane/tasks_cs1/milestones{/number}","notifications_url":"https://api.github.com/repos/olga-jane/tasks_cs1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olga-jane/tasks_cs1/labels{/name}","releases_url":"https://api.github.com/repos/olga-jane/tasks_cs1/releases{/id}","created_at":"2015-08-04T07:21:41Z","updated_at":"2015-08-04T07:47:12Z","pushed_at":"2015-09-09T10:25:10Z","git_url":"git://github.com/olga-jane/tasks_cs1.git","ssh_url":"git@github.com:olga-jane/tasks_cs1.git","clone_url":"https://github.com/olga-jane/tasks_cs1.git","svn_url":"https://github.com/olga-jane/tasks_cs1","homepage":null,"size":722,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29"},"html":{"href":"https://github.com/olga-jane/tasks_cs1/pull/29"},"issue":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/issues/29"},"comments":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/olga-jane/tasks_cs1/statuses/278cbe4d43eba608d713930f6ecbc5cb803ddd9d"}}}}