{"action":"created","comment":{"url":"https://api.github.com/repos/cilliemalan/Cargo/pulls/comments/77783730","id":77783730,"diff_hunk":"@@ -0,0 +1,132 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Data.Entity;\n+using System.Linq;\n+using System.Text;\n+using System.Text.RegularExpressions;\n+using System.Threading.Tasks;\n+\n+namespace Cargo\n+{\n+    /// <summary>\n+    /// Used to cache content inside cargo\n+    /// </summary>\n+    public sealed class ContentCache\n+    {\n+        private static volatile ContentCache instance;\n+        private static object syncRoot = new Object();\n+\n+        /// <summary>\n+        /// Items cached\n+        /// </summary>\n+        public List<ContentItem> ContentItems { get { return contentItems;  } }\n+        private List<ContentItem> contentItems;\n+\n+        private ContentCache() { }\n+\n+\n+        /// <summary>\n+        /// Since we only want one cache per application. Singleton pattern implementation chosen.\n+        /// </summary>\n+        public static ContentCache Instance","path":"Cargo.EntityFramework/ContentCache.cs","position":31,"original_position":31,"commit_id":"0a6b230110850a89b3b799824f5551f37226920e","original_commit_id":"fa230705f7cbf57acc56baff25a870106c7a6483","user":{"login":"cilliemalan","id":3305301,"avatar_url":"https://avatars.githubusercontent.com/u/3305301?v=3","gravatar_id":"","url":"https://api.github.com/users/cilliemalan","html_url":"https://github.com/cilliemalan","followers_url":"https://api.github.com/users/cilliemalan/followers","following_url":"https://api.github.com/users/cilliemalan/following{/other_user}","gists_url":"https://api.github.com/users/cilliemalan/gists{/gist_id}","starred_url":"https://api.github.com/users/cilliemalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilliemalan/subscriptions","organizations_url":"https://api.github.com/users/cilliemalan/orgs","repos_url":"https://api.github.com/users/cilliemalan/repos","events_url":"https://api.github.com/users/cilliemalan/events{/privacy}","received_events_url":"https://api.github.com/users/cilliemalan/received_events","type":"User","site_admin":false},"body":"Use `Lazy<ContentCache>` instead please","created_at":"2016-09-07T08:57:43Z","updated_at":"2016-09-07T08:57:43Z","html_url":"https://github.com/cilliemalan/Cargo/pull/1#discussion_r77783730","pull_request_url":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/cilliemalan/Cargo/pulls/comments/77783730"},"html":{"href":"https://github.com/cilliemalan/Cargo/pull/1#discussion_r77783730"},"pull_request":{"href":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1","id":83989558,"html_url":"https://github.com/cilliemalan/Cargo/pull/1","diff_url":"https://github.com/cilliemalan/Cargo/pull/1.diff","patch_url":"https://github.com/cilliemalan/Cargo/pull/1.patch","issue_url":"https://api.github.com/repos/cilliemalan/Cargo/issues/1","number":1,"state":"open","locked":false,"title":"Add caching to limit DB calls inside EntityFrameworkCargoDataSources","user":{"login":"rcrause","id":13965447,"avatar_url":"https://avatars.githubusercontent.com/u/13965447?v=3","gravatar_id":"","url":"https://api.github.com/users/rcrause","html_url":"https://github.com/rcrause","followers_url":"https://api.github.com/users/rcrause/followers","following_url":"https://api.github.com/users/rcrause/following{/other_user}","gists_url":"https://api.github.com/users/rcrause/gists{/gist_id}","starred_url":"https://api.github.com/users/rcrause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcrause/subscriptions","organizations_url":"https://api.github.com/users/rcrause/orgs","repos_url":"https://api.github.com/users/rcrause/repos","events_url":"https://api.github.com/users/rcrause/events{/privacy}","received_events_url":"https://api.github.com/users/rcrause/received_events","type":"User","site_admin":false},"body":"I've add Caching using a newly created ContentCache class; using it inside EntityFrameworkCargoDataSource. \r\n\r\nThe web config has been changed to run a trace more easily. The effect looks promising, but please do tell if you want an alternative approach (I'm sure there are plenty) or notice possible issues.","created_at":"2016-09-05T11:39:07Z","updated_at":"2016-09-07T08:57:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72aaafedd34e0e1fcc41ba9a449eb4676459b68a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1/commits","review_comments_url":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1/comments","review_comment_url":"https://api.github.com/repos/cilliemalan/Cargo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cilliemalan/Cargo/issues/1/comments","statuses_url":"https://api.github.com/repos/cilliemalan/Cargo/statuses/0a6b230110850a89b3b799824f5551f37226920e","head":{"label":"rcrause:master","ref":"master","sha":"0a6b230110850a89b3b799824f5551f37226920e","user":{"login":"rcrause","id":13965447,"avatar_url":"https://avatars.githubusercontent.com/u/13965447?v=3","gravatar_id":"","url":"https://api.github.com/users/rcrause","html_url":"https://github.com/rcrause","followers_url":"https://api.github.com/users/rcrause/followers","following_url":"https://api.github.com/users/rcrause/following{/other_user}","gists_url":"https://api.github.com/users/rcrause/gists{/gist_id}","starred_url":"https://api.github.com/users/rcrause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcrause/subscriptions","organizations_url":"https://api.github.com/users/rcrause/orgs","repos_url":"https://api.github.com/users/rcrause/repos","events_url":"https://api.github.com/users/rcrause/events{/privacy}","received_events_url":"https://api.github.com/users/rcrause/received_events","type":"User","site_admin":false},"repo":{"id":67399001,"name":"Cargo","full_name":"rcrause/Cargo","owner":{"login":"rcrause","id":13965447,"avatar_url":"https://avatars.githubusercontent.com/u/13965447?v=3","gravatar_id":"","url":"https://api.github.com/users/rcrause","html_url":"https://github.com/rcrause","followers_url":"https://api.github.com/users/rcrause/followers","following_url":"https://api.github.com/users/rcrause/following{/other_user}","gists_url":"https://api.github.com/users/rcrause/gists{/gist_id}","starred_url":"https://api.github.com/users/rcrause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcrause/subscriptions","organizations_url":"https://api.github.com/users/rcrause/orgs","repos_url":"https://api.github.com/users/rcrause/repos","events_url":"https://api.github.com/users/rcrause/events{/privacy}","received_events_url":"https://api.github.com/users/rcrause/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rcrause/Cargo","description":"A very very lightweight content management thingy for ASP.Net","fork":true,"url":"https://api.github.com/repos/rcrause/Cargo","forks_url":"https://api.github.com/repos/rcrause/Cargo/forks","keys_url":"https://api.github.com/repos/rcrause/Cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rcrause/Cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rcrause/Cargo/teams","hooks_url":"https://api.github.com/repos/rcrause/Cargo/hooks","issue_events_url":"https://api.github.com/repos/rcrause/Cargo/issues/events{/number}","events_url":"https://api.github.com/repos/rcrause/Cargo/events","assignees_url":"https://api.github.com/repos/rcrause/Cargo/assignees{/user}","branches_url":"https://api.github.com/repos/rcrause/Cargo/branches{/branch}","tags_url":"https://api.github.com/repos/rcrause/Cargo/tags","blobs_url":"https://api.github.com/repos/rcrause/Cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rcrause/Cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rcrause/Cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/rcrause/Cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rcrause/Cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/rcrause/Cargo/languages","stargazers_url":"https://api.github.com/repos/rcrause/Cargo/stargazers","contributors_url":"https://api.github.com/repos/rcrause/Cargo/contributors","subscribers_url":"https://api.github.com/repos/rcrause/Cargo/subscribers","subscription_url":"https://api.github.com/repos/rcrause/Cargo/subscription","commits_url":"https://api.github.com/repos/rcrause/Cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/rcrause/Cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/rcrause/Cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/rcrause/Cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/rcrause/Cargo/contents/{+path}","compare_url":"https://api.github.com/repos/rcrause/Cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rcrause/Cargo/merges","archive_url":"https://api.github.com/repos/rcrause/Cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rcrause/Cargo/downloads","issues_url":"https://api.github.com/repos/rcrause/Cargo/issues{/number}","pulls_url":"https://api.github.com/repos/rcrause/Cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/rcrause/Cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/rcrause/Cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rcrause/Cargo/labels{/name}","releases_url":"https://api.github.com/repos/rcrause/Cargo/releases{/id}","deployments_url":"https://api.github.com/repos/rcrause/Cargo/deployments","created_at":"2016-09-05T07:43:11Z","updated_at":"2016-09-05T07:43:14Z","pushed_at":"2016-09-05T11:17:18Z","git_url":"git://github.com/rcrause/Cargo.git","ssh_url":"git@github.com:rcrause/Cargo.git","clone_url":"https://github.com/rcrause/Cargo.git","svn_url":"https://github.com/rcrause/Cargo","homepage":null,"size":1209,"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":"cilliemalan:master","ref":"master","sha":"fea77e0a625a33fff70d1844997a75e00b7a5745","user":{"login":"cilliemalan","id":3305301,"avatar_url":"https://avatars.githubusercontent.com/u/3305301?v=3","gravatar_id":"","url":"https://api.github.com/users/cilliemalan","html_url":"https://github.com/cilliemalan","followers_url":"https://api.github.com/users/cilliemalan/followers","following_url":"https://api.github.com/users/cilliemalan/following{/other_user}","gists_url":"https://api.github.com/users/cilliemalan/gists{/gist_id}","starred_url":"https://api.github.com/users/cilliemalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilliemalan/subscriptions","organizations_url":"https://api.github.com/users/cilliemalan/orgs","repos_url":"https://api.github.com/users/cilliemalan/repos","events_url":"https://api.github.com/users/cilliemalan/events{/privacy}","received_events_url":"https://api.github.com/users/cilliemalan/received_events","type":"User","site_admin":false},"repo":{"id":39947810,"name":"Cargo","full_name":"cilliemalan/Cargo","owner":{"login":"cilliemalan","id":3305301,"avatar_url":"https://avatars.githubusercontent.com/u/3305301?v=3","gravatar_id":"","url":"https://api.github.com/users/cilliemalan","html_url":"https://github.com/cilliemalan","followers_url":"https://api.github.com/users/cilliemalan/followers","following_url":"https://api.github.com/users/cilliemalan/following{/other_user}","gists_url":"https://api.github.com/users/cilliemalan/gists{/gist_id}","starred_url":"https://api.github.com/users/cilliemalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilliemalan/subscriptions","organizations_url":"https://api.github.com/users/cilliemalan/orgs","repos_url":"https://api.github.com/users/cilliemalan/repos","events_url":"https://api.github.com/users/cilliemalan/events{/privacy}","received_events_url":"https://api.github.com/users/cilliemalan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cilliemalan/Cargo","description":"A very very lightweight content management thingy for ASP.Net","fork":false,"url":"https://api.github.com/repos/cilliemalan/Cargo","forks_url":"https://api.github.com/repos/cilliemalan/Cargo/forks","keys_url":"https://api.github.com/repos/cilliemalan/Cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cilliemalan/Cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cilliemalan/Cargo/teams","hooks_url":"https://api.github.com/repos/cilliemalan/Cargo/hooks","issue_events_url":"https://api.github.com/repos/cilliemalan/Cargo/issues/events{/number}","events_url":"https://api.github.com/repos/cilliemalan/Cargo/events","assignees_url":"https://api.github.com/repos/cilliemalan/Cargo/assignees{/user}","branches_url":"https://api.github.com/repos/cilliemalan/Cargo/branches{/branch}","tags_url":"https://api.github.com/repos/cilliemalan/Cargo/tags","blobs_url":"https://api.github.com/repos/cilliemalan/Cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cilliemalan/Cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cilliemalan/Cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/cilliemalan/Cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cilliemalan/Cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/cilliemalan/Cargo/languages","stargazers_url":"https://api.github.com/repos/cilliemalan/Cargo/stargazers","contributors_url":"https://api.github.com/repos/cilliemalan/Cargo/contributors","subscribers_url":"https://api.github.com/repos/cilliemalan/Cargo/subscribers","subscription_url":"https://api.github.com/repos/cilliemalan/Cargo/subscription","commits_url":"https://api.github.com/repos/cilliemalan/Cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/cilliemalan/Cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/cilliemalan/Cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/cilliemalan/Cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/cilliemalan/Cargo/contents/{+path}","compare_url":"https://api.github.com/repos/cilliemalan/Cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cilliemalan/Cargo/merges","archive_url":"https://api.github.com/repos/cilliemalan/Cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cilliemalan/Cargo/downloads","issues_url":"https://api.github.com/repos/cilliemalan/Cargo/issues{/number}","pulls_url":"https://api.github.com/repos/cilliemalan/Cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/cilliemalan/Cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/cilliemalan/Cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cilliemalan/Cargo/labels{/name}","releases_url":"https://api.github.com/repos/cilliemalan/Cargo/releases{/id}","deployments_url":"https://api.github.com/repos/cilliemalan/Cargo/deployments","created_at":"2015-07-30T11:47:33Z","updated_at":"2016-01-12T07:18:55Z","pushed_at":"2016-09-05T11:39:08Z","git_url":"git://github.com/cilliemalan/Cargo.git","ssh_url":"git@github.com:cilliemalan/Cargo.git","clone_url":"https://github.com/cilliemalan/Cargo.git","svn_url":"https://github.com/cilliemalan/Cargo","homepage":null,"size":1206,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1"},"html":{"href":"https://github.com/cilliemalan/Cargo/pull/1"},"issue":{"href":"https://api.github.com/repos/cilliemalan/Cargo/issues/1"},"comments":{"href":"https://api.github.com/repos/cilliemalan/Cargo/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/cilliemalan/Cargo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cilliemalan/Cargo/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/cilliemalan/Cargo/statuses/0a6b230110850a89b3b799824f5551f37226920e"}}}}
{"actor":{"display_login":"cilliemalan"}}