{"action":"created","comment":{"url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/comments/196899032","pull_request_review_id":130536407,"id":196899032,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Njg5OTAzMg==","diff_hunk":"@@ -0,0 +1,50 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+using Housing.Forecast.Context;\n+using Housing.Forecast.Context.Models;\n+using Microsoft.EntityFrameworkCore;\n+\n+namespace Housing.Forecast.Context.Repos\n+{\n+    public class RoomRepo : IRepo<Room>\n+    {\n+        private readonly IForecastContext _context;\n+        public RoomRepo(IForecastContext context)\n+        {\n+            _context = context;\n+        }\n+\n+        /// <summary>\n+        /// Find all of the distinct locations for every snapshot.\n+        /// </summary>\n+        /// <returns>\n+        /// This method will return a list of all distinct locations for the snapshots within the database.\n+        /// </returns>\n+        public async Task<IList<string>> GetLocationsAsync() {\n+            return await _context.Rooms.Select(s => s.Location).Where(s => s != null).Distinct().ToListAsync();\n+        }\n+\n+        public async Task<IList<Room>> GetAsync()\n+        {\n+            return await _context.Rooms.Where(s => s != null).ToListAsync();\n+        }\n+\n+        public async Task<IList<Room>> GetByLocationAsync(DateTime datetime, string location)\n+        {\n+            return await _context.Rooms.Where(r =>\n+                r.Created.Date <= datetime.Date && (r.Deleted.Value == null || r.Deleted.Value.Date > datetime.Date) &&\n+                r.Location == location).ToListAsync();\n+        }\n+\n+        public async Task<IList<Room>> GetByDateAsync(DateTime datetime)\n+        {\n+            return await _context.Rooms.Where(u =>\n+                    u.Created.Date <= datetime.Date &&\n+                    (u.Deleted.Value == null || u.Deleted.Value.Date > datetime.Date))","path":"src/Housing.Forecast.Context/Repos/RoomRepo.cs","position":46,"original_position":46,"commit_id":"39a00bd72641ae9fac9035b71b8d2ed577b2874a","original_commit_id":"39a00bd72641ae9fac9035b71b8d2ed577b2874a","user":{"login":"fredbelotte","id":22018714,"node_id":"MDQ6VXNlcjIyMDE4NzE0","avatar_url":"https://avatars3.githubusercontent.com/u/22018714?v=4","gravatar_id":"","url":"https://api.github.com/users/fredbelotte","html_url":"https://github.com/fredbelotte","followers_url":"https://api.github.com/users/fredbelotte/followers","following_url":"https://api.github.com/users/fredbelotte/following{/other_user}","gists_url":"https://api.github.com/users/fredbelotte/gists{/gist_id}","starred_url":"https://api.github.com/users/fredbelotte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredbelotte/subscriptions","organizations_url":"https://api.github.com/users/fredbelotte/orgs","repos_url":"https://api.github.com/users/fredbelotte/repos","events_url":"https://api.github.com/users/fredbelotte/events{/privacy}","received_events_url":"https://api.github.com/users/fredbelotte/received_events","type":"User","site_admin":false},"body":"![Code Smell](https://sonarsource.github.io/sonar-github/code_smell.png 'Code Smell') Code Smell: Change this condition so that it does not always evaluate to 'false'. ([csharpsquid:S2589](https://sonarcloud.io/organizations/revaturecloud/rules#rule_key=csharpsquid%3AS2589))\n\n[See it in SonarCloud](https://sonarcloud.io/project/issues?id=housing%3Aforecast&pullRequest=21&issues=AWQdeRBa_bEzQ-kUUGw4&open=AWQdeRBa_bEzQ-kUUGw4)\n\n[ISSUE_KEY]: AWQdeRBa_bEzQ-kUUGw4","created_at":"2018-06-20T18:35:10Z","updated_at":"2018-06-20T18:35:14Z","html_url":"https://github.com/revaturecloud/housing-forecast/pull/21#discussion_r196899032","pull_request_url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/comments/196899032"},"html":{"href":"https://github.com/revaturecloud/housing-forecast/pull/21#discussion_r196899032"},"pull_request":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21","id":195985353,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1OTg1MzUz","html_url":"https://github.com/revaturecloud/housing-forecast/pull/21","diff_url":"https://github.com/revaturecloud/housing-forecast/pull/21.diff","patch_url":"https://github.com/revaturecloud/housing-forecast/pull/21.patch","issue_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/21","number":21,"state":"open","locked":false,"title":"Broker","user":{"login":"escalonn","id":2515013,"node_id":"MDQ6VXNlcjI1MTUwMTM=","avatar_url":"https://avatars0.githubusercontent.com/u/2515013?v=4","gravatar_id":"","url":"https://api.github.com/users/escalonn","html_url":"https://github.com/escalonn","followers_url":"https://api.github.com/users/escalonn/followers","following_url":"https://api.github.com/users/escalonn/following{/other_user}","gists_url":"https://api.github.com/users/escalonn/gists{/gist_id}","starred_url":"https://api.github.com/users/escalonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escalonn/subscriptions","organizations_url":"https://api.github.com/users/escalonn/orgs","repos_url":"https://api.github.com/users/escalonn/repos","events_url":"https://api.github.com/users/escalonn/events{/privacy}","received_events_url":"https://api.github.com/users/escalonn/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-19T23:30:11Z","updated_at":"2018-06-20T18:35:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77baae078ac304962b15a9169f2dfb2cd33ab178","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21/commits","review_comments_url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21/comments","review_comment_url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/21/comments","statuses_url":"https://api.github.com/repos/revaturecloud/housing-forecast/statuses/39a00bd72641ae9fac9035b71b8d2ed577b2874a","head":{"label":"revaturecloud:broker","ref":"broker","sha":"39a00bd72641ae9fac9035b71b8d2ed577b2874a","user":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"repo":{"id":131664861,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE2NjQ4NjE=","name":"housing-forecast","full_name":"revaturecloud/housing-forecast","owner":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/revaturecloud/housing-forecast","description":"the housing forecast api.","fork":false,"url":"https://api.github.com/repos/revaturecloud/housing-forecast","forks_url":"https://api.github.com/repos/revaturecloud/housing-forecast/forks","keys_url":"https://api.github.com/repos/revaturecloud/housing-forecast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/revaturecloud/housing-forecast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/revaturecloud/housing-forecast/teams","hooks_url":"https://api.github.com/repos/revaturecloud/housing-forecast/hooks","issue_events_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/events{/number}","events_url":"https://api.github.com/repos/revaturecloud/housing-forecast/events","assignees_url":"https://api.github.com/repos/revaturecloud/housing-forecast/assignees{/user}","branches_url":"https://api.github.com/repos/revaturecloud/housing-forecast/branches{/branch}","tags_url":"https://api.github.com/repos/revaturecloud/housing-forecast/tags","blobs_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/refs{/sha}","trees_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/revaturecloud/housing-forecast/statuses/{sha}","languages_url":"https://api.github.com/repos/revaturecloud/housing-forecast/languages","stargazers_url":"https://api.github.com/repos/revaturecloud/housing-forecast/stargazers","contributors_url":"https://api.github.com/repos/revaturecloud/housing-forecast/contributors","subscribers_url":"https://api.github.com/repos/revaturecloud/housing-forecast/subscribers","subscription_url":"https://api.github.com/repos/revaturecloud/housing-forecast/subscription","commits_url":"https://api.github.com/repos/revaturecloud/housing-forecast/commits{/sha}","git_commits_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/commits{/sha}","comments_url":"https://api.github.com/repos/revaturecloud/housing-forecast/comments{/number}","issue_comment_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/comments{/number}","contents_url":"https://api.github.com/repos/revaturecloud/housing-forecast/contents/{+path}","compare_url":"https://api.github.com/repos/revaturecloud/housing-forecast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/revaturecloud/housing-forecast/merges","archive_url":"https://api.github.com/repos/revaturecloud/housing-forecast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/revaturecloud/housing-forecast/downloads","issues_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues{/number}","pulls_url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls{/number}","milestones_url":"https://api.github.com/repos/revaturecloud/housing-forecast/milestones{/number}","notifications_url":"https://api.github.com/repos/revaturecloud/housing-forecast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/revaturecloud/housing-forecast/labels{/name}","releases_url":"https://api.github.com/repos/revaturecloud/housing-forecast/releases{/id}","deployments_url":"https://api.github.com/repos/revaturecloud/housing-forecast/deployments","created_at":"2018-05-01T01:34:41Z","updated_at":"2018-06-09T16:41:14Z","pushed_at":"2018-06-20T18:33:15Z","git_url":"git://github.com/revaturecloud/housing-forecast.git","ssh_url":"git@github.com:revaturecloud/housing-forecast.git","clone_url":"https://github.com/revaturecloud/housing-forecast.git","svn_url":"https://github.com/revaturecloud/housing-forecast","homepage":null,"size":383,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"revaturecloud:lesser","ref":"lesser","sha":"bfa4821e9de1017a3f0ace645e5f632cfaa07f68","user":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"repo":{"id":131664861,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE2NjQ4NjE=","name":"housing-forecast","full_name":"revaturecloud/housing-forecast","owner":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/revaturecloud/housing-forecast","description":"the housing forecast api.","fork":false,"url":"https://api.github.com/repos/revaturecloud/housing-forecast","forks_url":"https://api.github.com/repos/revaturecloud/housing-forecast/forks","keys_url":"https://api.github.com/repos/revaturecloud/housing-forecast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/revaturecloud/housing-forecast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/revaturecloud/housing-forecast/teams","hooks_url":"https://api.github.com/repos/revaturecloud/housing-forecast/hooks","issue_events_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/events{/number}","events_url":"https://api.github.com/repos/revaturecloud/housing-forecast/events","assignees_url":"https://api.github.com/repos/revaturecloud/housing-forecast/assignees{/user}","branches_url":"https://api.github.com/repos/revaturecloud/housing-forecast/branches{/branch}","tags_url":"https://api.github.com/repos/revaturecloud/housing-forecast/tags","blobs_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/refs{/sha}","trees_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/revaturecloud/housing-forecast/statuses/{sha}","languages_url":"https://api.github.com/repos/revaturecloud/housing-forecast/languages","stargazers_url":"https://api.github.com/repos/revaturecloud/housing-forecast/stargazers","contributors_url":"https://api.github.com/repos/revaturecloud/housing-forecast/contributors","subscribers_url":"https://api.github.com/repos/revaturecloud/housing-forecast/subscribers","subscription_url":"https://api.github.com/repos/revaturecloud/housing-forecast/subscription","commits_url":"https://api.github.com/repos/revaturecloud/housing-forecast/commits{/sha}","git_commits_url":"https://api.github.com/repos/revaturecloud/housing-forecast/git/commits{/sha}","comments_url":"https://api.github.com/repos/revaturecloud/housing-forecast/comments{/number}","issue_comment_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/comments{/number}","contents_url":"https://api.github.com/repos/revaturecloud/housing-forecast/contents/{+path}","compare_url":"https://api.github.com/repos/revaturecloud/housing-forecast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/revaturecloud/housing-forecast/merges","archive_url":"https://api.github.com/repos/revaturecloud/housing-forecast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/revaturecloud/housing-forecast/downloads","issues_url":"https://api.github.com/repos/revaturecloud/housing-forecast/issues{/number}","pulls_url":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls{/number}","milestones_url":"https://api.github.com/repos/revaturecloud/housing-forecast/milestones{/number}","notifications_url":"https://api.github.com/repos/revaturecloud/housing-forecast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/revaturecloud/housing-forecast/labels{/name}","releases_url":"https://api.github.com/repos/revaturecloud/housing-forecast/releases{/id}","deployments_url":"https://api.github.com/repos/revaturecloud/housing-forecast/deployments","created_at":"2018-05-01T01:34:41Z","updated_at":"2018-06-09T16:41:14Z","pushed_at":"2018-06-20T18:33:15Z","git_url":"git://github.com/revaturecloud/housing-forecast.git","ssh_url":"git@github.com:revaturecloud/housing-forecast.git","clone_url":"https://github.com/revaturecloud/housing-forecast.git","svn_url":"https://github.com/revaturecloud/housing-forecast","homepage":null,"size":383,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21"},"html":{"href":"https://github.com/revaturecloud/housing-forecast/pull/21"},"issue":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/21"},"comments":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/revaturecloud/housing-forecast/statuses/39a00bd72641ae9fac9035b71b8d2ed577b2874a"}},"author_association":"NONE"}}
{"actor":{"display_login":"fredbelotte"}}