{"action":"created","comment":{"url":"https://api.github.com/repos/umm/cafu_kvs/pulls/comments/204284018","pull_request_review_id":139334335,"id":204284018,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDI4NDAxOA==","diff_hunk":"@@ -52,22 +54,27 @@ public DefaultKeyValueRepository Create(string savePath)\n \n         public TEntity GetEntity<TEntity>(string key) where TEntity : class, IEntity\n         {\n-            return this.DataStore.GetEntity<TEntity>(key);\n+            return DataStore.GetEntity<TEntity>(key);\n+        }\n+\n+        public TEntity GetOrCreateEntity<TEntity>(string key) where TEntity : class, IEntity, new()\n+        {\n+            return GetEntity<TEntity>(key) ?? new TEntity();","path":"Assets/Scripts/Domain/Repository/DefaultKeyValueRepository.cs","position":31,"original_position":31,"commit_id":"1db143948b3becca79464608890689eafc869e15","original_commit_id":"1db143948b3becca79464608890689eafc869e15","user":{"login":"monry","id":838945,"node_id":"MDQ6VXNlcjgzODk0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/838945?v=4","gravatar_id":"","url":"https://api.github.com/users/monry","html_url":"https://github.com/monry","followers_url":"https://api.github.com/users/monry/followers","following_url":"https://api.github.com/users/monry/following{/other_user}","gists_url":"https://api.github.com/users/monry/gists{/gist_id}","starred_url":"https://api.github.com/users/monry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monry/subscriptions","organizations_url":"https://api.github.com/users/monry/orgs","repos_url":"https://api.github.com/users/monry/repos","events_url":"https://api.github.com/users/monry/events{/privacy}","received_events_url":"https://api.github.com/users/monry/received_events","type":"User","site_admin":false},"body":"結局、null だったら new するだけのメソッドに変更","created_at":"2018-07-23T05:17:39Z","updated_at":"2018-07-23T05:19:22Z","html_url":"https://github.com/umm/cafu_kvs/pull/12#discussion_r204284018","pull_request_url":"https://api.github.com/repos/umm/cafu_kvs/pulls/12","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/umm/cafu_kvs/pulls/comments/204284018"},"html":{"href":"https://github.com/umm/cafu_kvs/pull/12#discussion_r204284018"},"pull_request":{"href":"https://api.github.com/repos/umm/cafu_kvs/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/umm/cafu_kvs/pulls/12","id":203095187,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDk1MTg3","html_url":"https://github.com/umm/cafu_kvs/pull/12","diff_url":"https://github.com/umm/cafu_kvs/pull/12.diff","patch_url":"https://github.com/umm/cafu_kvs/pull/12.patch","issue_url":"https://api.github.com/repos/umm/cafu_kvs/issues/12","number":12,"state":"open","locked":false,"title":"Add GetOrCreateEntity<T>(key)","user":{"login":"monry","id":838945,"node_id":"MDQ6VXNlcjgzODk0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/838945?v=4","gravatar_id":"","url":"https://api.github.com/users/monry","html_url":"https://github.com/monry","followers_url":"https://api.github.com/users/monry/followers","following_url":"https://api.github.com/users/monry/following{/other_user}","gists_url":"https://api.github.com/users/monry/gists{/gist_id}","starred_url":"https://api.github.com/users/monry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monry/subscriptions","organizations_url":"https://api.github.com/users/monry/orgs","repos_url":"https://api.github.com/users/monry/repos","events_url":"https://api.github.com/users/monry/events{/privacy}","received_events_url":"https://api.github.com/users/monry/received_events","type":"User","site_admin":false},"body":"## What\r\n\r\n* Fixed #11 \r\n* Add `GetOrCreateEntity<T>(string key)`\r\n    * Create and set empty entity instance into stored DataStore\r\n* Rename asmdef\r\n","created_at":"2018-07-23T02:32:39Z","updated_at":"2018-07-23T05:19:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30df96bbebac47a81f2750e0643accf38406dabe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/umm/cafu_kvs/pulls/12/commits","review_comments_url":"https://api.github.com/repos/umm/cafu_kvs/pulls/12/comments","review_comment_url":"https://api.github.com/repos/umm/cafu_kvs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/umm/cafu_kvs/issues/12/comments","statuses_url":"https://api.github.com/repos/umm/cafu_kvs/statuses/1db143948b3becca79464608890689eafc869e15","head":{"label":"umm:feat/add_getorcreateentity","ref":"feat/add_getorcreateentity","sha":"1db143948b3becca79464608890689eafc869e15","user":{"login":"umm","id":30266422,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjY2NDIy","avatar_url":"https://avatars0.githubusercontent.com/u/30266422?v=4","gravatar_id":"","url":"https://api.github.com/users/umm","html_url":"https://github.com/umm","followers_url":"https://api.github.com/users/umm/followers","following_url":"https://api.github.com/users/umm/following{/other_user}","gists_url":"https://api.github.com/users/umm/gists{/gist_id}","starred_url":"https://api.github.com/users/umm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umm/subscriptions","organizations_url":"https://api.github.com/users/umm/orgs","repos_url":"https://api.github.com/users/umm/repos","events_url":"https://api.github.com/users/umm/events{/privacy}","received_events_url":"https://api.github.com/users/umm/received_events","type":"Organization","site_admin":false},"repo":{"id":135130230,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUxMzAyMzA=","name":"cafu_kvs","full_name":"umm/cafu_kvs","owner":{"login":"umm","id":30266422,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjY2NDIy","avatar_url":"https://avatars0.githubusercontent.com/u/30266422?v=4","gravatar_id":"","url":"https://api.github.com/users/umm","html_url":"https://github.com/umm","followers_url":"https://api.github.com/users/umm/followers","following_url":"https://api.github.com/users/umm/following{/other_user}","gists_url":"https://api.github.com/users/umm/gists{/gist_id}","starred_url":"https://api.github.com/users/umm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umm/subscriptions","organizations_url":"https://api.github.com/users/umm/orgs","repos_url":"https://api.github.com/users/umm/repos","events_url":"https://api.github.com/users/umm/events{/privacy}","received_events_url":"https://api.github.com/users/umm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/umm/cafu_kvs","description":"Simple file based key value store system :green_book:","fork":false,"url":"https://api.github.com/repos/umm/cafu_kvs","forks_url":"https://api.github.com/repos/umm/cafu_kvs/forks","keys_url":"https://api.github.com/repos/umm/cafu_kvs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umm/cafu_kvs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umm/cafu_kvs/teams","hooks_url":"https://api.github.com/repos/umm/cafu_kvs/hooks","issue_events_url":"https://api.github.com/repos/umm/cafu_kvs/issues/events{/number}","events_url":"https://api.github.com/repos/umm/cafu_kvs/events","assignees_url":"https://api.github.com/repos/umm/cafu_kvs/assignees{/user}","branches_url":"https://api.github.com/repos/umm/cafu_kvs/branches{/branch}","tags_url":"https://api.github.com/repos/umm/cafu_kvs/tags","blobs_url":"https://api.github.com/repos/umm/cafu_kvs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umm/cafu_kvs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umm/cafu_kvs/git/refs{/sha}","trees_url":"https://api.github.com/repos/umm/cafu_kvs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umm/cafu_kvs/statuses/{sha}","languages_url":"https://api.github.com/repos/umm/cafu_kvs/languages","stargazers_url":"https://api.github.com/repos/umm/cafu_kvs/stargazers","contributors_url":"https://api.github.com/repos/umm/cafu_kvs/contributors","subscribers_url":"https://api.github.com/repos/umm/cafu_kvs/subscribers","subscription_url":"https://api.github.com/repos/umm/cafu_kvs/subscription","commits_url":"https://api.github.com/repos/umm/cafu_kvs/commits{/sha}","git_commits_url":"https://api.github.com/repos/umm/cafu_kvs/git/commits{/sha}","comments_url":"https://api.github.com/repos/umm/cafu_kvs/comments{/number}","issue_comment_url":"https://api.github.com/repos/umm/cafu_kvs/issues/comments{/number}","contents_url":"https://api.github.com/repos/umm/cafu_kvs/contents/{+path}","compare_url":"https://api.github.com/repos/umm/cafu_kvs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umm/cafu_kvs/merges","archive_url":"https://api.github.com/repos/umm/cafu_kvs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umm/cafu_kvs/downloads","issues_url":"https://api.github.com/repos/umm/cafu_kvs/issues{/number}","pulls_url":"https://api.github.com/repos/umm/cafu_kvs/pulls{/number}","milestones_url":"https://api.github.com/repos/umm/cafu_kvs/milestones{/number}","notifications_url":"https://api.github.com/repos/umm/cafu_kvs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umm/cafu_kvs/labels{/name}","releases_url":"https://api.github.com/repos/umm/cafu_kvs/releases{/id}","deployments_url":"https://api.github.com/repos/umm/cafu_kvs/deployments","created_at":"2018-05-28T08:11:21Z","updated_at":"2018-07-19T02:03:23Z","pushed_at":"2018-07-23T05:16:03Z","git_url":"git://github.com/umm/cafu_kvs.git","ssh_url":"git@github.com:umm/cafu_kvs.git","clone_url":"https://github.com/umm/cafu_kvs.git","svn_url":"https://github.com/umm/cafu_kvs","homepage":null,"size":44,"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":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"umm:master","ref":"master","sha":"7d1eb5c036732de2ac465d4beeaf9d9f1ce6203c","user":{"login":"umm","id":30266422,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjY2NDIy","avatar_url":"https://avatars0.githubusercontent.com/u/30266422?v=4","gravatar_id":"","url":"https://api.github.com/users/umm","html_url":"https://github.com/umm","followers_url":"https://api.github.com/users/umm/followers","following_url":"https://api.github.com/users/umm/following{/other_user}","gists_url":"https://api.github.com/users/umm/gists{/gist_id}","starred_url":"https://api.github.com/users/umm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umm/subscriptions","organizations_url":"https://api.github.com/users/umm/orgs","repos_url":"https://api.github.com/users/umm/repos","events_url":"https://api.github.com/users/umm/events{/privacy}","received_events_url":"https://api.github.com/users/umm/received_events","type":"Organization","site_admin":false},"repo":{"id":135130230,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUxMzAyMzA=","name":"cafu_kvs","full_name":"umm/cafu_kvs","owner":{"login":"umm","id":30266422,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjY2NDIy","avatar_url":"https://avatars0.githubusercontent.com/u/30266422?v=4","gravatar_id":"","url":"https://api.github.com/users/umm","html_url":"https://github.com/umm","followers_url":"https://api.github.com/users/umm/followers","following_url":"https://api.github.com/users/umm/following{/other_user}","gists_url":"https://api.github.com/users/umm/gists{/gist_id}","starred_url":"https://api.github.com/users/umm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umm/subscriptions","organizations_url":"https://api.github.com/users/umm/orgs","repos_url":"https://api.github.com/users/umm/repos","events_url":"https://api.github.com/users/umm/events{/privacy}","received_events_url":"https://api.github.com/users/umm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/umm/cafu_kvs","description":"Simple file based key value store system :green_book:","fork":false,"url":"https://api.github.com/repos/umm/cafu_kvs","forks_url":"https://api.github.com/repos/umm/cafu_kvs/forks","keys_url":"https://api.github.com/repos/umm/cafu_kvs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umm/cafu_kvs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umm/cafu_kvs/teams","hooks_url":"https://api.github.com/repos/umm/cafu_kvs/hooks","issue_events_url":"https://api.github.com/repos/umm/cafu_kvs/issues/events{/number}","events_url":"https://api.github.com/repos/umm/cafu_kvs/events","assignees_url":"https://api.github.com/repos/umm/cafu_kvs/assignees{/user}","branches_url":"https://api.github.com/repos/umm/cafu_kvs/branches{/branch}","tags_url":"https://api.github.com/repos/umm/cafu_kvs/tags","blobs_url":"https://api.github.com/repos/umm/cafu_kvs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umm/cafu_kvs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umm/cafu_kvs/git/refs{/sha}","trees_url":"https://api.github.com/repos/umm/cafu_kvs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umm/cafu_kvs/statuses/{sha}","languages_url":"https://api.github.com/repos/umm/cafu_kvs/languages","stargazers_url":"https://api.github.com/repos/umm/cafu_kvs/stargazers","contributors_url":"https://api.github.com/repos/umm/cafu_kvs/contributors","subscribers_url":"https://api.github.com/repos/umm/cafu_kvs/subscribers","subscription_url":"https://api.github.com/repos/umm/cafu_kvs/subscription","commits_url":"https://api.github.com/repos/umm/cafu_kvs/commits{/sha}","git_commits_url":"https://api.github.com/repos/umm/cafu_kvs/git/commits{/sha}","comments_url":"https://api.github.com/repos/umm/cafu_kvs/comments{/number}","issue_comment_url":"https://api.github.com/repos/umm/cafu_kvs/issues/comments{/number}","contents_url":"https://api.github.com/repos/umm/cafu_kvs/contents/{+path}","compare_url":"https://api.github.com/repos/umm/cafu_kvs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umm/cafu_kvs/merges","archive_url":"https://api.github.com/repos/umm/cafu_kvs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umm/cafu_kvs/downloads","issues_url":"https://api.github.com/repos/umm/cafu_kvs/issues{/number}","pulls_url":"https://api.github.com/repos/umm/cafu_kvs/pulls{/number}","milestones_url":"https://api.github.com/repos/umm/cafu_kvs/milestones{/number}","notifications_url":"https://api.github.com/repos/umm/cafu_kvs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umm/cafu_kvs/labels{/name}","releases_url":"https://api.github.com/repos/umm/cafu_kvs/releases{/id}","deployments_url":"https://api.github.com/repos/umm/cafu_kvs/deployments","created_at":"2018-05-28T08:11:21Z","updated_at":"2018-07-19T02:03:23Z","pushed_at":"2018-07-23T05:16:03Z","git_url":"git://github.com/umm/cafu_kvs.git","ssh_url":"git@github.com:umm/cafu_kvs.git","clone_url":"https://github.com/umm/cafu_kvs.git","svn_url":"https://github.com/umm/cafu_kvs","homepage":null,"size":44,"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":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/umm/cafu_kvs/pulls/12"},"html":{"href":"https://github.com/umm/cafu_kvs/pull/12"},"issue":{"href":"https://api.github.com/repos/umm/cafu_kvs/issues/12"},"comments":{"href":"https://api.github.com/repos/umm/cafu_kvs/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/umm/cafu_kvs/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/umm/cafu_kvs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/umm/cafu_kvs/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/umm/cafu_kvs/statuses/1db143948b3becca79464608890689eafc869e15"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"monry"}}