{"action":"created","issue":{"url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/39","repository_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver","labels_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/39/comments","events_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/39/events","html_url":"https://github.com/bchavez/RethinkDb.Driver/issues/39","id":145079696,"number":39,"title":"JObject roundtrip issue","user":{"login":"oliverjanik","id":2280140,"avatar_url":"https://avatars.githubusercontent.com/u/2280140?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverjanik","html_url":"https://github.com/oliverjanik","followers_url":"https://api.github.com/users/oliverjanik/followers","following_url":"https://api.github.com/users/oliverjanik/following{/other_user}","gists_url":"https://api.github.com/users/oliverjanik/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverjanik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverjanik/subscriptions","organizations_url":"https://api.github.com/users/oliverjanik/orgs","repos_url":"https://api.github.com/users/oliverjanik/repos","events_url":"https://api.github.com/users/oliverjanik/events{/privacy}","received_events_url":"https://api.github.com/users/oliverjanik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-01T03:47:22Z","updated_at":"2016-04-01T05:29:52Z","closed_at":null,"body":"As promised here's a test that fails JObject roundtrip failing test. Just drop it into the `GitHubIssues.cs`\r\n\r\n```csharp\r\n        [Test]\r\n        public void issue_39()\r\n        {\r\n            var dateTime = DateTime.Parse(\"2016-09-03T10:30:20Z\");\r\n            var obj = new JObject(new JProperty(\"timestamp\", dateTime));\r\n\r\n            var table = R.Db(DbName).Table(TableName);\r\n            table.Delete().Run(conn);\r\n\r\n            var result = table.Insert(obj).RunResult(conn);\r\n            var id = result.GeneratedKeys[0];\r\n\r\n            var check = table.Get(id).RunAtom<JObject>(conn);\r\n            check.Dump();\r\n\r\n            var dt = (DateTime)check[\"timestamp\"];\r\n            dt.Should().Be(dateTime);\r\n        }\r\n```\r\n\r\nThere's the output of `check.Dump()`: \r\n\r\n```json\r\n{\r\n  \"id\": \"e605a378-d8f9-4d0d-b910-e4707c0ce6b0\",\r\n  \"timestamp\": {\r\n    \"$reql_type$\": \"TIME\",\r\n    \"epoch_time\": 1472898620,\r\n    \"timezone\": \"+10:00\"\r\n  }\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/comments/204254027","html_url":"https://github.com/bchavez/RethinkDb.Driver/issues/39#issuecomment-204254027","issue_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/39","id":204254027,"user":{"login":"bchavez","id":478118,"avatar_url":"https://avatars.githubusercontent.com/u/478118?v=3","gravatar_id":"","url":"https://api.github.com/users/bchavez","html_url":"https://github.com/bchavez","followers_url":"https://api.github.com/users/bchavez/followers","following_url":"https://api.github.com/users/bchavez/following{/other_user}","gists_url":"https://api.github.com/users/bchavez/gists{/gist_id}","starred_url":"https://api.github.com/users/bchavez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bchavez/subscriptions","organizations_url":"https://api.github.com/users/bchavez/orgs","repos_url":"https://api.github.com/users/bchavez/repos","events_url":"https://api.github.com/users/bchavez/events{/privacy}","received_events_url":"https://api.github.com/users/bchavez/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T05:29:52Z","updated_at":"2016-04-01T05:29:52Z","body":"Hey Oliver,\r\n\r\nThanks for taking the time to report this. I appreciate it.\r\n\r\nI think what's happening here is when you specify `RunAtom<JObject>` the driver passes `JObject` to Newtonsoft. This causes Newtonsoft totally bypasses our converters because it doesn't need them for converting a `JObject`. So, `check` remains a `JObject` pseudo type. It's almost like a manual mode. There's a blurb about raw types in the documentation [**Raw Format Options** wiki page here](https://github.com/bchavez/RethinkDb.Driver/wiki/Differences-Between-C%23-and-Java-driver#raw-format-options). I updated a note about it under [Extra C# Features:JObject Support](https://github.com/bchavez/RethinkDb.Driver/wiki/Extra-C%23-Driver-Features#jobject-support).\r\n\r\nIf you want to pull this `DateTime` out of the `JObject` pseudo type, you'll need to do something like this:\r\n\r\n```\r\nvar dt = check[\"timestamp\"].ToObject<DateTime>(Net.Converter.Serializer);\r\n```\r\n\r\nLet me know if this helps.\r\n\r\nPS. I'm going on vacation tomorrow morning. So I won't be back for a couple of weeks. Also, I won't be around the Internet very much during my time off."}}