{"action":"created","issue":{"url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/10","labels_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/10/comments","events_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/10/events","html_url":"https://github.com/bchavez/RethinkDb.Driver/issues/10","id":116342299,"number":10,"title":"JsonReaderException when retrieving documents containing DateTime","user":{"login":"fiLLLip","id":1264369,"avatar_url":"https://avatars.githubusercontent.com/u/1264369?v=3","gravatar_id":"","url":"https://api.github.com/users/fiLLLip","html_url":"https://github.com/fiLLLip","followers_url":"https://api.github.com/users/fiLLLip/followers","following_url":"https://api.github.com/users/fiLLLip/following{/other_user}","gists_url":"https://api.github.com/users/fiLLLip/gists{/gist_id}","starred_url":"https://api.github.com/users/fiLLLip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiLLLip/subscriptions","organizations_url":"https://api.github.com/users/fiLLLip/orgs","repos_url":"https://api.github.com/users/fiLLLip/repos","events_url":"https://api.github.com/users/fiLLLip/events{/privacy}","received_events_url":"https://api.github.com/users/fiLLLip/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-11T14:12:59Z","updated_at":"2015-11-12T07:22:43Z","closed_at":null,"body":"I have the following code:\r\n```\r\n    Cursor<User> result = _table.run<User>(_c.Connection);\r\n    return result.BufferedItems;\r\n```\r\nI only have one document in my database looking like this (raw fetched with web ui):\r\n```\r\n[{\"Address\":null,\"Birthday\":{\"$reql_type$\":\"TIME\",\"epoch_time\":650937600,\"timezone\":\"+02:00\"},\"DisplayName\":\"fiLLLip\",\"Email\":\"filip@example.com\",\"FirstName\":\"Filip\",\"LastName\":\"Tomren\",\"MiddleName\":\"Andre Larsen\",\"Phone\":\"+47123455678\",\"Picture\":null,\"TenantPermissions\":null,\"id\":\"aa93ca25-8672-4545-a927-90b9b1249f4c\"}]\r\n```\r\nWhen I run the code supplied I get the following exception:\r\n```\r\n$exception\t{\"Error reading date. Unexpected token: StartObject. Path 'Birthday', line 1, position 40.\"} {$4}\tNewtonsoft.Json.JsonReaderException\r\n```\r\nWith the following stack trace:\r\n```\r\nNewtonsoft.Json.JsonReader.ReadAsDateTimeInternal()\r\nNewtonsoft.Json.Linq.JTokenReader.ReadAsDateTime()\r\nNewtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)\r\nNewtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)\r\nNewtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\r\nNewtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\r\nNewtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\r\nNewtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\r\nNewtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)\r\nNewtonsoft.Json.Linq.JToken.ToObject(Type objectType)\r\nNewtonsoft.Json.Linq.JToken.ToObject[T]()\r\nRethinkDb.Driver.Net.Cursor`1.<>c.<get_BufferedItems>b__17_0(JToken t)\r\nSystem.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\r\nSystem.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\nSystem.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\nRethinkDb.Driver.Net.Cursor`1.get_BufferedItems()\r\nTestSoftware.DataAccess.Database.RethinkDb.UserService.GetAll() UserService.cs: line: 54\r\nTestSoftware.Api.Controllers.UsersController.Get() UsersController.cs: line: 26\r\n```\r\nMy `User` object looks like this (BaseModel contains an id field):\r\n```\r\npublic class User : BaseModel\r\n    {\r\n        public IList<TenantPermission> TenantPermissions { get; set; }\r\n        public string Email { get; set; }\r\n        public string Phone { get; set; }\r\n        public string Picture { get; set; }\r\n        public DateTime Birthday { get; set; }\r\n        public string DisplayName { get; set; }\r\n        public string FirstName { get; set; }\r\n        public string MiddleName { get; set; }\r\n        public string LastName { get; set; }\r\n        public Address Address { get; set; }\r\n    }\r\n```\r\nMy user object was added with the `RethinkDb.Driver`, and posted with the following through an ASP.NET MVC controller:\r\n```\r\n{\r\n\t\"Email\": \"filip@example.com\",\r\n\t\"Phone\": \"+4712345678\",\r\n\t\"DisplayName\": \"fiLLLip\",\r\n\t\"FirstName\": \"Filip\",\r\n\t\"MiddleName\": \"Andre Larsen\",\r\n\t\"LastName\": \"Tomren\",\r\n\t\"Birthday\": \"1990-08-18T00:00:00-00:00\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/comments/156022142","html_url":"https://github.com/bchavez/RethinkDb.Driver/issues/10#issuecomment-156022142","issue_url":"https://api.github.com/repos/bchavez/RethinkDb.Driver/issues/10","id":156022142,"user":{"login":"fiLLLip","id":1264369,"avatar_url":"https://avatars.githubusercontent.com/u/1264369?v=3","gravatar_id":"","url":"https://api.github.com/users/fiLLLip","html_url":"https://github.com/fiLLLip","followers_url":"https://api.github.com/users/fiLLLip/followers","following_url":"https://api.github.com/users/fiLLLip/following{/other_user}","gists_url":"https://api.github.com/users/fiLLLip/gists{/gist_id}","starred_url":"https://api.github.com/users/fiLLLip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiLLLip/subscriptions","organizations_url":"https://api.github.com/users/fiLLLip/orgs","repos_url":"https://api.github.com/users/fiLLLip/repos","events_url":"https://api.github.com/users/fiLLLip/events{/privacy}","received_events_url":"https://api.github.com/users/fiLLLip/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T07:22:43Z","updated_at":"2015-11-12T07:22:43Z","body":"I think it would be nice to be able to use `DateTime` if you want, and then we could enforce UTC when serializing/deserializing.\r\n\r\nI tested now with `DateTimeOffset`, but I got the same error as when using `DateTime`."}}