{"action":"created","comment":{"url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/comments/185537853","pull_request_review_id":116946217,"id":185537853,"diff_hunk":"@@ -0,0 +1,161 @@\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using MySql.Data.MySqlClient;\n+using Dapper;\n+\n+namespace SqlIntro\n+{\n+    public class DapperProductRepository : IProductRepository\n+    {\n+        private readonly string _connectionString;\n+        public DapperProductRepository(string connectionString)\n+        {\n+            _connectionString = connectionString;\n+        }\n+        /// <summary>\n+        /// Reads all the products from the products table\n+        /// </summary>\n+        /// <returns></returns>\n+        public IEnumerable<Product> GetProducts(int id)\n+        {\n+            var products = new List<Product>();\n+            try\n+            {\n+                using (var conn = new MySqlConnection(_connectionString.ToString()))\n+                {\n+                    // var sql = \"SELECT ProductID AS Id, Name FROM product;\";\n+                    var sql = (id > 0) ? \"SELECT ProductID AS ID, Name FROM product WHERE ProductId > @ID1 AND ProductId < @ID2\" :\n+                                         \"SELECT ProductID AS ID, Name FROM product;\";\n+                    conn.Open();\n+                    products = conn.Query<Product>(sql,new { ID1 = id -15, ID2 = id + 15 }).ToList();\n+                }\n+            }\n+            catch (Exception e)\n+            {\n+                Console.WriteLine(e);\n+            }\n+            return products;\n+        }\n+        public Product GetProduct(int id)\n+        {\n+            Product prod = null;\n+            try\n+            {\n+                using (var conn = new MySqlConnection(_connectionString.ToString()))\n+                {\n+                    conn.Open();\n+                    var sql = \"SELECT ProductID AS ID, Name FROM product WHERE ProductID = @Id;\";\n+                    prod = conn.Query<Product>(sql, new Product { Id = id }).FirstOrDefault();","path":"SqlIntro/DapperProductRepository.cs","position":49,"original_position":49,"commit_id":"e7202993c1d075e36d211cf2ed04856f14ff1e11","original_commit_id":"e7202993c1d075e36d211cf2ed04856f14ff1e11","user":{"login":"codytwinton","id":4325900,"avatar_url":"https://avatars3.githubusercontent.com/u/4325900?v=4","gravatar_id":"","url":"https://api.github.com/users/codytwinton","html_url":"https://github.com/codytwinton","followers_url":"https://api.github.com/users/codytwinton/followers","following_url":"https://api.github.com/users/codytwinton/following{/other_user}","gists_url":"https://api.github.com/users/codytwinton/gists{/gist_id}","starred_url":"https://api.github.com/users/codytwinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codytwinton/subscriptions","organizations_url":"https://api.github.com/users/codytwinton/orgs","repos_url":"https://api.github.com/users/codytwinton/repos","events_url":"https://api.github.com/users/codytwinton/events{/privacy}","received_events_url":"https://api.github.com/users/codytwinton/received_events","type":"User","site_admin":false},"body":"Merely return this value","created_at":"2018-05-02T15:27:16Z","updated_at":"2018-05-02T15:31:42Z","html_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1/pull/1#discussion_r185537853","pull_request_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/comments/185537853"},"html":{"href":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1/pull/1#discussion_r185537853"},"pull_request":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1","id":185236460,"html_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1/pull/1","diff_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1/pull/1.diff","patch_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1/pull/1.patch","issue_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/1","number":1,"state":"open","locked":false,"title":"Sql kata","user":{"login":"reidbraswell1","id":20757348,"avatar_url":"https://avatars2.githubusercontent.com/u/20757348?v=4","gravatar_id":"","url":"https://api.github.com/users/reidbraswell1","html_url":"https://github.com/reidbraswell1","followers_url":"https://api.github.com/users/reidbraswell1/followers","following_url":"https://api.github.com/users/reidbraswell1/following{/other_user}","gists_url":"https://api.github.com/users/reidbraswell1/gists{/gist_id}","starred_url":"https://api.github.com/users/reidbraswell1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reidbraswell1/subscriptions","organizations_url":"https://api.github.com/users/reidbraswell1/orgs","repos_url":"https://api.github.com/users/reidbraswell1/repos","events_url":"https://api.github.com/users/reidbraswell1/events{/privacy}","received_events_url":"https://api.github.com/users/reidbraswell1/received_events","type":"User","site_admin":false},"body":"*Ready for review.*","created_at":"2018-05-01T18:04:42Z","updated_at":"2018-05-02T15:31:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91fc7467c4a82e6fc86c1195364d6440c6ccd1d8","assignee":{"login":"codytwinton","id":4325900,"avatar_url":"https://avatars3.githubusercontent.com/u/4325900?v=4","gravatar_id":"","url":"https://api.github.com/users/codytwinton","html_url":"https://github.com/codytwinton","followers_url":"https://api.github.com/users/codytwinton/followers","following_url":"https://api.github.com/users/codytwinton/following{/other_user}","gists_url":"https://api.github.com/users/codytwinton/gists{/gist_id}","starred_url":"https://api.github.com/users/codytwinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codytwinton/subscriptions","organizations_url":"https://api.github.com/users/codytwinton/orgs","repos_url":"https://api.github.com/users/codytwinton/repos","events_url":"https://api.github.com/users/codytwinton/events{/privacy}","received_events_url":"https://api.github.com/users/codytwinton/received_events","type":"User","site_admin":false},"assignees":[{"login":"codytwinton","id":4325900,"avatar_url":"https://avatars3.githubusercontent.com/u/4325900?v=4","gravatar_id":"","url":"https://api.github.com/users/codytwinton","html_url":"https://github.com/codytwinton","followers_url":"https://api.github.com/users/codytwinton/followers","following_url":"https://api.github.com/users/codytwinton/following{/other_user}","gists_url":"https://api.github.com/users/codytwinton/gists{/gist_id}","starred_url":"https://api.github.com/users/codytwinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codytwinton/subscriptions","organizations_url":"https://api.github.com/users/codytwinton/orgs","repos_url":"https://api.github.com/users/codytwinton/repos","events_url":"https://api.github.com/users/codytwinton/events{/privacy}","received_events_url":"https://api.github.com/users/codytwinton/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1/commits","review_comments_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1/comments","review_comment_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/1/comments","statuses_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/statuses/e7202993c1d075e36d211cf2ed04856f14ff1e11","head":{"label":"truecodersio:Sql-Kata","ref":"Sql-Kata","sha":"e7202993c1d075e36d211cf2ed04856f14ff1e11","user":{"login":"truecodersio","id":30969089,"avatar_url":"https://avatars3.githubusercontent.com/u/30969089?v=4","gravatar_id":"","url":"https://api.github.com/users/truecodersio","html_url":"https://github.com/truecodersio","followers_url":"https://api.github.com/users/truecodersio/followers","following_url":"https://api.github.com/users/truecodersio/following{/other_user}","gists_url":"https://api.github.com/users/truecodersio/gists{/gist_id}","starred_url":"https://api.github.com/users/truecodersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truecodersio/subscriptions","organizations_url":"https://api.github.com/users/truecodersio/orgs","repos_url":"https://api.github.com/users/truecodersio/repos","events_url":"https://api.github.com/users/truecodersio/events{/privacy}","received_events_url":"https://api.github.com/users/truecodersio/received_events","type":"Organization","site_admin":false},"repo":{"id":131332552,"name":"kata-sql-intro-reidbraswell1","full_name":"truecodersio/kata-sql-intro-reidbraswell1","owner":{"login":"truecodersio","id":30969089,"avatar_url":"https://avatars3.githubusercontent.com/u/30969089?v=4","gravatar_id":"","url":"https://api.github.com/users/truecodersio","html_url":"https://github.com/truecodersio","followers_url":"https://api.github.com/users/truecodersio/followers","following_url":"https://api.github.com/users/truecodersio/following{/other_user}","gists_url":"https://api.github.com/users/truecodersio/gists{/gist_id}","starred_url":"https://api.github.com/users/truecodersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truecodersio/subscriptions","organizations_url":"https://api.github.com/users/truecodersio/orgs","repos_url":"https://api.github.com/users/truecodersio/repos","events_url":"https://api.github.com/users/truecodersio/events{/privacy}","received_events_url":"https://api.github.com/users/truecodersio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1","description":"kata-sql-intro-reidbraswell1 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1","forks_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/forks","keys_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/teams","hooks_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/hooks","issue_events_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/events{/number}","events_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/events","assignees_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/assignees{/user}","branches_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/branches{/branch}","tags_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/tags","blobs_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/refs{/sha}","trees_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/statuses/{sha}","languages_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/languages","stargazers_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/stargazers","contributors_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/contributors","subscribers_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/subscribers","subscription_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/subscription","commits_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/commits{/sha}","git_commits_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/commits{/sha}","comments_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/comments{/number}","issue_comment_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/comments{/number}","contents_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/contents/{+path}","compare_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/merges","archive_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/downloads","issues_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues{/number}","pulls_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls{/number}","milestones_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/milestones{/number}","notifications_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/labels{/name}","releases_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/releases{/id}","deployments_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/deployments","created_at":"2018-04-27T18:36:56Z","updated_at":"2018-04-27T18:37:10Z","pushed_at":"2018-05-01T18:04:43Z","git_url":"git://github.com/truecodersio/kata-sql-intro-reidbraswell1.git","ssh_url":"git@github.com:truecodersio/kata-sql-intro-reidbraswell1.git","clone_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1.git","svn_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"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"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"truecodersio:master","ref":"master","sha":"f8b4609c732c2775cdc20d061a2e8218296c6870","user":{"login":"truecodersio","id":30969089,"avatar_url":"https://avatars3.githubusercontent.com/u/30969089?v=4","gravatar_id":"","url":"https://api.github.com/users/truecodersio","html_url":"https://github.com/truecodersio","followers_url":"https://api.github.com/users/truecodersio/followers","following_url":"https://api.github.com/users/truecodersio/following{/other_user}","gists_url":"https://api.github.com/users/truecodersio/gists{/gist_id}","starred_url":"https://api.github.com/users/truecodersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truecodersio/subscriptions","organizations_url":"https://api.github.com/users/truecodersio/orgs","repos_url":"https://api.github.com/users/truecodersio/repos","events_url":"https://api.github.com/users/truecodersio/events{/privacy}","received_events_url":"https://api.github.com/users/truecodersio/received_events","type":"Organization","site_admin":false},"repo":{"id":131332552,"name":"kata-sql-intro-reidbraswell1","full_name":"truecodersio/kata-sql-intro-reidbraswell1","owner":{"login":"truecodersio","id":30969089,"avatar_url":"https://avatars3.githubusercontent.com/u/30969089?v=4","gravatar_id":"","url":"https://api.github.com/users/truecodersio","html_url":"https://github.com/truecodersio","followers_url":"https://api.github.com/users/truecodersio/followers","following_url":"https://api.github.com/users/truecodersio/following{/other_user}","gists_url":"https://api.github.com/users/truecodersio/gists{/gist_id}","starred_url":"https://api.github.com/users/truecodersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truecodersio/subscriptions","organizations_url":"https://api.github.com/users/truecodersio/orgs","repos_url":"https://api.github.com/users/truecodersio/repos","events_url":"https://api.github.com/users/truecodersio/events{/privacy}","received_events_url":"https://api.github.com/users/truecodersio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1","description":"kata-sql-intro-reidbraswell1 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1","forks_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/forks","keys_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/teams","hooks_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/hooks","issue_events_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/events{/number}","events_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/events","assignees_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/assignees{/user}","branches_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/branches{/branch}","tags_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/tags","blobs_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/refs{/sha}","trees_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/statuses/{sha}","languages_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/languages","stargazers_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/stargazers","contributors_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/contributors","subscribers_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/subscribers","subscription_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/subscription","commits_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/commits{/sha}","git_commits_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/git/commits{/sha}","comments_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/comments{/number}","issue_comment_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/comments{/number}","contents_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/contents/{+path}","compare_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/merges","archive_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/downloads","issues_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues{/number}","pulls_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls{/number}","milestones_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/milestones{/number}","notifications_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/labels{/name}","releases_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/releases{/id}","deployments_url":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/deployments","created_at":"2018-04-27T18:36:56Z","updated_at":"2018-04-27T18:37:10Z","pushed_at":"2018-05-01T18:04:43Z","git_url":"git://github.com/truecodersio/kata-sql-intro-reidbraswell1.git","ssh_url":"git@github.com:truecodersio/kata-sql-intro-reidbraswell1.git","clone_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1.git","svn_url":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"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"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1"},"html":{"href":"https://github.com/truecodersio/kata-sql-intro-reidbraswell1/pull/1"},"issue":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/1"},"comments":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/truecodersio/kata-sql-intro-reidbraswell1/statuses/e7202993c1d075e36d211cf2ed04856f14ff1e11"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"codytwinton"}}