{"action":"created","comment":{"url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/comments/38497208","id":38497208,"diff_hunk":"@@ -18,36 +33,88 @@ public DefaultMessageConverter(JsonSerializer jsonSerializer, IContextData<Messa\n         }\n \n         public IMessage ConvertMessage(object payload)\n-        { \n-            var message = new Message();\n-            message.Id = Guid.NewGuid();\n-            message.Type = payload.GetType().FullName;\n-            message.Payload = _jsonSerializer.Serialize(payload);\n-            message.Context = _contextData.Value;\n+        {\n+            var message = new Message\n+            {\n+                Id = Guid.NewGuid(),\n+                Types = GetTypes(payload),\n+                Payload = _jsonSerializer.Serialize(payload),\n+                Context = _contextData.Value,\n+                Indices = GetIndices(payload)\n+            };\n \n-            ProcessIndices(payload, message);\n-            ProcessTags(payload, message);\n+            message.Payload = _jsonSerializer.Serialize(message);\n \n             return message;\n-        } \n+        }\n \n-        private void ProcessIndices(object payload, Message message)\n+        private static IEnumerable<string> GetTypes(object payload)\n         {\n-            var indicesPayload = payload as IMessageIndices;\n-            if (indicesPayload?.Indices != null)\n+            var typeInfo = payload.GetType().GetTypeInfo();\n+\n+            return typeInfo.BaseTypes(includeSelf: true)\n+                .Concat(typeInfo.ImplementedInterfaces)\n+                .Except(_exclusions)\n+                .Select(t => t.KebabCase());\n+        }\n+\n+        private static IReadOnlyDictionary<string, object> GetIndices(object payload)","path":"src/Glimpse.Common/Broker/DefaultMessageConverter.cs","position":70,"original_position":70,"commit_id":"c8d57744e96e65ece60c5ac0c8c58f05f2868099","original_commit_id":"c8d57744e96e65ece60c5ac0c8c58f05f2868099","user":{"login":"avanderhoorn","id":585619,"avatar_url":"https://avatars.githubusercontent.com/u/585619?v=3","gravatar_id":"","url":"https://api.github.com/users/avanderhoorn","html_url":"https://github.com/avanderhoorn","followers_url":"https://api.github.com/users/avanderhoorn/followers","following_url":"https://api.github.com/users/avanderhoorn/following{/other_user}","gists_url":"https://api.github.com/users/avanderhoorn/gists{/gist_id}","starred_url":"https://api.github.com/users/avanderhoorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avanderhoorn/subscriptions","organizations_url":"https://api.github.com/users/avanderhoorn/orgs","repos_url":"https://api.github.com/users/avanderhoorn/repos","events_url":"https://api.github.com/users/avanderhoorn/events{/privacy}","received_events_url":"https://api.github.com/users/avanderhoorn/received_events","type":"User","site_admin":false},"body":"I wonder if its worth pulling out the indices and type stuff into separate providers provider? It would mean the complexity of the class is reduced a bit and if someone wanted to augment the behaviour they could. I'm not super passionate about it, but food for thought. ","created_at":"2015-09-02T04:02:02Z","updated_at":"2015-09-02T04:02:02Z","html_url":"https://github.com/Glimpse/Glimpse.Prototype/pull/16#discussion_r38497208","pull_request_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/comments/38497208"},"html":{"href":"https://github.com/Glimpse/Glimpse.Prototype/pull/16#discussion_r38497208"},"pull_request":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16","id":41277712,"html_url":"https://github.com/Glimpse/Glimpse.Prototype/pull/16","diff_url":"https://github.com/Glimpse/Glimpse.Prototype/pull/16.diff","patch_url":"https://github.com/Glimpse/Glimpse.Prototype/pull/16.patch","issue_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/16","number":16,"state":"open","locked":false,"title":"Integrate In-memory persistence store","user":{"login":"nikmd23","id":199026,"avatar_url":"https://avatars.githubusercontent.com/u/199026?v=3","gravatar_id":"","url":"https://api.github.com/users/nikmd23","html_url":"https://github.com/nikmd23","followers_url":"https://api.github.com/users/nikmd23/followers","following_url":"https://api.github.com/users/nikmd23/following{/other_user}","gists_url":"https://api.github.com/users/nikmd23/gists{/gist_id}","starred_url":"https://api.github.com/users/nikmd23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikmd23/subscriptions","organizations_url":"https://api.github.com/users/nikmd23/orgs","repos_url":"https://api.github.com/users/nikmd23/repos","events_url":"https://api.github.com/users/nikmd23/events{/privacy}","received_events_url":"https://api.github.com/users/nikmd23/received_events","type":"User","site_admin":false},"body":"@nikmd23 has already built a working spike of the in-memory persistence store. \r\n\r\nThis work is to integrate it back into the Glimpse repo.","created_at":"2015-07-30T20:23:57Z","updated_at":"2015-09-02T04:02:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7030edffc74d4c6e46355cad265e5e881ef8916","assignee":{"login":"nikmd23","id":199026,"avatar_url":"https://avatars.githubusercontent.com/u/199026?v=3","gravatar_id":"","url":"https://api.github.com/users/nikmd23","html_url":"https://github.com/nikmd23","followers_url":"https://api.github.com/users/nikmd23/followers","following_url":"https://api.github.com/users/nikmd23/following{/other_user}","gists_url":"https://api.github.com/users/nikmd23/gists{/gist_id}","starred_url":"https://api.github.com/users/nikmd23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikmd23/subscriptions","organizations_url":"https://api.github.com/users/nikmd23/orgs","repos_url":"https://api.github.com/users/nikmd23/repos","events_url":"https://api.github.com/users/nikmd23/events{/privacy}","received_events_url":"https://api.github.com/users/nikmd23/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/milestones/3","html_url":"https://github.com/Glimpse/Glimpse.Prototype/milestones/2015.09.04%20-%203","labels_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/milestones/3/labels","id":1270061,"number":3,"title":"2015.09.04 - 3","description":"The theme and goals for this sprint are to finish the infrastructure required by the SPA client. The intention is for the *next* sprint to be dedicated to the client UI, so all groundwork needs to be laid now.","creator":{"login":"nikmd23","id":199026,"avatar_url":"https://avatars.githubusercontent.com/u/199026?v=3","gravatar_id":"","url":"https://api.github.com/users/nikmd23","html_url":"https://github.com/nikmd23","followers_url":"https://api.github.com/users/nikmd23/followers","following_url":"https://api.github.com/users/nikmd23/following{/other_user}","gists_url":"https://api.github.com/users/nikmd23/gists{/gist_id}","starred_url":"https://api.github.com/users/nikmd23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikmd23/subscriptions","organizations_url":"https://api.github.com/users/nikmd23/orgs","repos_url":"https://api.github.com/users/nikmd23/repos","events_url":"https://api.github.com/users/nikmd23/events{/privacy}","received_events_url":"https://api.github.com/users/nikmd23/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":7,"state":"open","created_at":"2015-08-24T18:42:10Z","updated_at":"2015-09-01T06:06:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16/commits","review_comments_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16/comments","review_comment_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/16/comments","statuses_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/statuses/c8d57744e96e65ece60c5ac0c8c58f05f2868099","head":{"label":"Glimpse:16-integrate-in-memory-store","ref":"16-integrate-in-memory-store","sha":"c8d57744e96e65ece60c5ac0c8c58f05f2868099","user":{"login":"Glimpse","id":585916,"avatar_url":"https://avatars.githubusercontent.com/u/585916?v=3","gravatar_id":"","url":"https://api.github.com/users/Glimpse","html_url":"https://github.com/Glimpse","followers_url":"https://api.github.com/users/Glimpse/followers","following_url":"https://api.github.com/users/Glimpse/following{/other_user}","gists_url":"https://api.github.com/users/Glimpse/gists{/gist_id}","starred_url":"https://api.github.com/users/Glimpse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glimpse/subscriptions","organizations_url":"https://api.github.com/users/Glimpse/orgs","repos_url":"https://api.github.com/users/Glimpse/repos","events_url":"https://api.github.com/users/Glimpse/events{/privacy}","received_events_url":"https://api.github.com/users/Glimpse/received_events","type":"Organization","site_admin":false},"repo":{"id":26886551,"name":"Glimpse.Prototype","full_name":"Glimpse/Glimpse.Prototype","owner":{"login":"Glimpse","id":585916,"avatar_url":"https://avatars.githubusercontent.com/u/585916?v=3","gravatar_id":"","url":"https://api.github.com/users/Glimpse","html_url":"https://github.com/Glimpse","followers_url":"https://api.github.com/users/Glimpse/followers","following_url":"https://api.github.com/users/Glimpse/following{/other_user}","gists_url":"https://api.github.com/users/Glimpse/gists{/gist_id}","starred_url":"https://api.github.com/users/Glimpse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glimpse/subscriptions","organizations_url":"https://api.github.com/users/Glimpse/orgs","repos_url":"https://api.github.com/users/Glimpse/repos","events_url":"https://api.github.com/users/Glimpse/events{/privacy}","received_events_url":"https://api.github.com/users/Glimpse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Glimpse/Glimpse.Prototype","description":"Glimpse v2 prototype","fork":false,"url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype","forks_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/forks","keys_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/teams","hooks_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/hooks","issue_events_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/events{/number}","events_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/events","assignees_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/assignees{/user}","branches_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/branches{/branch}","tags_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/tags","blobs_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/languages","stargazers_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/stargazers","contributors_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/contributors","subscribers_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/subscribers","subscription_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/subscription","commits_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/contents/{+path}","compare_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/merges","archive_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/downloads","issues_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues{/number}","pulls_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/labels{/name}","releases_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/releases{/id}","created_at":"2014-11-19T23:25:14Z","updated_at":"2015-09-01T11:55:49Z","pushed_at":"2015-09-01T23:53:39Z","git_url":"git://github.com/Glimpse/Glimpse.Prototype.git","ssh_url":"git@github.com:Glimpse/Glimpse.Prototype.git","clone_url":"https://github.com/Glimpse/Glimpse.Prototype.git","svn_url":"https://github.com/Glimpse/Glimpse.Prototype","homepage":null,"size":2988,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":7,"default_branch":"dev"}},"base":{"label":"Glimpse:dev","ref":"dev","sha":"f0533ee5ff117a073d0fd7b93996e959d52de03e","user":{"login":"Glimpse","id":585916,"avatar_url":"https://avatars.githubusercontent.com/u/585916?v=3","gravatar_id":"","url":"https://api.github.com/users/Glimpse","html_url":"https://github.com/Glimpse","followers_url":"https://api.github.com/users/Glimpse/followers","following_url":"https://api.github.com/users/Glimpse/following{/other_user}","gists_url":"https://api.github.com/users/Glimpse/gists{/gist_id}","starred_url":"https://api.github.com/users/Glimpse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glimpse/subscriptions","organizations_url":"https://api.github.com/users/Glimpse/orgs","repos_url":"https://api.github.com/users/Glimpse/repos","events_url":"https://api.github.com/users/Glimpse/events{/privacy}","received_events_url":"https://api.github.com/users/Glimpse/received_events","type":"Organization","site_admin":false},"repo":{"id":26886551,"name":"Glimpse.Prototype","full_name":"Glimpse/Glimpse.Prototype","owner":{"login":"Glimpse","id":585916,"avatar_url":"https://avatars.githubusercontent.com/u/585916?v=3","gravatar_id":"","url":"https://api.github.com/users/Glimpse","html_url":"https://github.com/Glimpse","followers_url":"https://api.github.com/users/Glimpse/followers","following_url":"https://api.github.com/users/Glimpse/following{/other_user}","gists_url":"https://api.github.com/users/Glimpse/gists{/gist_id}","starred_url":"https://api.github.com/users/Glimpse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glimpse/subscriptions","organizations_url":"https://api.github.com/users/Glimpse/orgs","repos_url":"https://api.github.com/users/Glimpse/repos","events_url":"https://api.github.com/users/Glimpse/events{/privacy}","received_events_url":"https://api.github.com/users/Glimpse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Glimpse/Glimpse.Prototype","description":"Glimpse v2 prototype","fork":false,"url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype","forks_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/forks","keys_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/teams","hooks_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/hooks","issue_events_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/events{/number}","events_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/events","assignees_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/assignees{/user}","branches_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/branches{/branch}","tags_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/tags","blobs_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/languages","stargazers_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/stargazers","contributors_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/contributors","subscribers_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/subscribers","subscription_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/subscription","commits_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/contents/{+path}","compare_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/merges","archive_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/downloads","issues_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues{/number}","pulls_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/labels{/name}","releases_url":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/releases{/id}","created_at":"2014-11-19T23:25:14Z","updated_at":"2015-09-01T11:55:49Z","pushed_at":"2015-09-01T23:53:39Z","git_url":"git://github.com/Glimpse/Glimpse.Prototype.git","ssh_url":"git@github.com:Glimpse/Glimpse.Prototype.git","clone_url":"https://github.com/Glimpse/Glimpse.Prototype.git","svn_url":"https://github.com/Glimpse/Glimpse.Prototype","homepage":null,"size":2988,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":7,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16"},"html":{"href":"https://github.com/Glimpse/Glimpse.Prototype/pull/16"},"issue":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/16"},"comments":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/Glimpse/Glimpse.Prototype/statuses/c8d57744e96e65ece60c5ac0c8c58f05f2868099"}}}}