{"action":"created","issue":{"url":"https://api.github.com/repos/esskar/Serialize.Linq/issues/62","labels_url":"https://api.github.com/repos/esskar/Serialize.Linq/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/esskar/Serialize.Linq/issues/62/comments","events_url":"https://api.github.com/repos/esskar/Serialize.Linq/issues/62/events","html_url":"https://github.com/esskar/Serialize.Linq/pull/62","id":105750296,"number":62,"title":"Support Type constants","user":{"login":"gulbanana","id":1612285,"avatar_url":"https://avatars.githubusercontent.com/u/1612285?v=3","gravatar_id":"","url":"https://api.github.com/users/gulbanana","html_url":"https://github.com/gulbanana","followers_url":"https://api.github.com/users/gulbanana/followers","following_url":"https://api.github.com/users/gulbanana/following{/other_user}","gists_url":"https://api.github.com/users/gulbanana/gists{/gist_id}","starred_url":"https://api.github.com/users/gulbanana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gulbanana/subscriptions","organizations_url":"https://api.github.com/users/gulbanana/orgs","repos_url":"https://api.github.com/users/gulbanana/repos","events_url":"https://api.github.com/users/gulbanana/events{/privacy}","received_events_url":"https://api.github.com/users/gulbanana/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-10T07:41:04Z","updated_at":"2015-09-10T21:36:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/esskar/Serialize.Linq/pulls/62","html_url":"https://github.com/esskar/Serialize.Linq/pull/62","diff_url":"https://github.com/esskar/Serialize.Linq/pull/62.diff","patch_url":"https://github.com/esskar/Serialize.Linq/pull/62.patch"},"body":"Code like `q.Where(x => x.GetType() == typeof(Foo)) ` produces expression trees containing a ConstantExpression with .Type = System.RuntimeType. These can be converted to and from ConstantExpressionNodes with .ToExpressionNode(), but currently the resulting ExpressionNode cannot be serialised.\r\n\r\nThe problem is that the DataContract serializer will encounter a polymorphic-typed value with runtime type System.RuntimeType. These can't be converted to json/xml/etc, and even if you fool it by using a monomorphic box, the resulting serialized text can't be deserialized as Activator.CreateInstance() also does not work on Type/RuntimeType.\r\n\r\nThis pull request enables serialization of these expressions by using a TypeNode internally, similar to how TypeBinaryNode does it. The Type is converted to a TypeNode when stored in ConstantExpressionNode.Value, and then resolved to a real Type in ToExpression()."},"comment":{"url":"https://api.github.com/repos/esskar/Serialize.Linq/issues/comments/139386129","html_url":"https://github.com/esskar/Serialize.Linq/pull/62#issuecomment-139386129","issue_url":"https://api.github.com/repos/esskar/Serialize.Linq/issues/62","id":139386129,"user":{"login":"esskar","id":65206,"avatar_url":"https://avatars.githubusercontent.com/u/65206?v=3","gravatar_id":"","url":"https://api.github.com/users/esskar","html_url":"https://github.com/esskar","followers_url":"https://api.github.com/users/esskar/followers","following_url":"https://api.github.com/users/esskar/following{/other_user}","gists_url":"https://api.github.com/users/esskar/gists{/gist_id}","starred_url":"https://api.github.com/users/esskar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esskar/subscriptions","organizations_url":"https://api.github.com/users/esskar/orgs","repos_url":"https://api.github.com/users/esskar/repos","events_url":"https://api.github.com/users/esskar/events{/privacy}","received_events_url":"https://api.github.com/users/esskar/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T21:36:07Z","updated_at":"2015-09-10T21:36:07Z","body":"thanks for that. will check soon"}}