{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-dotnet/issues/514","repository_url":"https://api.github.com/repos/realm/realm-dotnet","labels_url":"https://api.github.com/repos/realm/realm-dotnet/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-dotnet/issues/514/comments","events_url":"https://api.github.com/repos/realm/realm-dotnet/issues/514/events","html_url":"https://github.com/realm/realm-dotnet/issues/514","id":153104337,"number":514,"title":"Manage a Standalone RealmObject from a JSON response deserialized into a RealmObject","user":{"login":"CrimsonKyle","id":16037523,"avatar_url":"https://avatars.githubusercontent.com/u/16037523?v=3","gravatar_id":"","url":"https://api.github.com/users/CrimsonKyle","html_url":"https://github.com/CrimsonKyle","followers_url":"https://api.github.com/users/CrimsonKyle/followers","following_url":"https://api.github.com/users/CrimsonKyle/following{/other_user}","gists_url":"https://api.github.com/users/CrimsonKyle/gists{/gist_id}","starred_url":"https://api.github.com/users/CrimsonKyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrimsonKyle/subscriptions","organizations_url":"https://api.github.com/users/CrimsonKyle/orgs","repos_url":"https://api.github.com/users/CrimsonKyle/repos","events_url":"https://api.github.com/users/CrimsonKyle/events{/privacy}","received_events_url":"https://api.github.com/users/CrimsonKyle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-dotnet/labels/T:Help","name":"T:Help","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"fealebenpae","id":289915,"avatar_url":"https://avatars.githubusercontent.com/u/289915?v=3","gravatar_id":"","url":"https://api.github.com/users/fealebenpae","html_url":"https://github.com/fealebenpae","followers_url":"https://api.github.com/users/fealebenpae/followers","following_url":"https://api.github.com/users/fealebenpae/following{/other_user}","gists_url":"https://api.github.com/users/fealebenpae/gists{/gist_id}","starred_url":"https://api.github.com/users/fealebenpae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fealebenpae/subscriptions","organizations_url":"https://api.github.com/users/fealebenpae/orgs","repos_url":"https://api.github.com/users/fealebenpae/repos","events_url":"https://api.github.com/users/fealebenpae/events{/privacy}","received_events_url":"https://api.github.com/users/fealebenpae/received_events","type":"User","site_admin":false},"assignees":[{"login":"fealebenpae","id":289915,"avatar_url":"https://avatars.githubusercontent.com/u/289915?v=3","gravatar_id":"","url":"https://api.github.com/users/fealebenpae","html_url":"https://github.com/fealebenpae","followers_url":"https://api.github.com/users/fealebenpae/followers","following_url":"https://api.github.com/users/fealebenpae/following{/other_user}","gists_url":"https://api.github.com/users/fealebenpae/gists{/gist_id}","starred_url":"https://api.github.com/users/fealebenpae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fealebenpae/subscriptions","organizations_url":"https://api.github.com/users/fealebenpae/orgs","repos_url":"https://api.github.com/users/fealebenpae/repos","events_url":"https://api.github.com/users/fealebenpae/events{/privacy}","received_events_url":"https://api.github.com/users/fealebenpae/received_events","type":"User","site_admin":false}],"milestone":null,"comments":37,"created_at":"2016-05-04T20:15:18Z","updated_at":"2016-08-01T18:52:01Z","closed_at":"2016-05-06T12:48:50Z","body":"I need Realm to Manage a JSON result that is deserialized into a RealmObject.  What is the best way of doing this?\r\n\r\nError:  System.Reflection.TargetInvocationException: \"Exception has been thrown by the target of an invocation.\"\r\n\r\n```\r\npublic void FetchParent () \r\n{\r\n    // get the JSON object for the parent object \t\r\n    var client = new RestClient (); \t\r\n    client.BaseUrl = new Uri (\"https://baseurl.com”);  \t\r\n    var request = new RestRequest (\"service/12345”, Method.GET); \t\r\n    request.XmlSerializer.ContentType = \"applicaiton/json\";  \t\r\n    IRestResponse response = client.Execute (request); \t\r\n    var object = JsonConvert.DeserializeObject<Parent> (response.Content); \t\r\n\r\n\t// manage the standalone deserialized realm object\r\n\trealm.Write (() => { \r\n\t\trealm.Manage<Parent>(object); \t\r\n         } ); \r\n}\r\n```\r\n\r\n//************MODELS**************//\r\n\r\n```\r\npublic class Parent : RealmObject\r\n{\r\n\t[ObjectId]\r\n\tpublic string ParentId { get; set; }\r\n\tpublic DateTimeOffset ObjectDatestamp { get; set; }\r\n\r\n\tpublic string FirstName { get; set; }\r\n\tpublic string LastName { get; set; }\r\n\tpublic RealmList<Dogs> Dogs { get; }\r\n}\r\n\r\npublic class Dog : RealmObject\r\n{\r\n\t[ObjectId]\r\n\tpublic string DogId { get; set; }\r\n\tpublic DateTimeOffset ObjectDatestamp { get; set; }\r\n\r\n\tpublic string Type { get; set; }\r\n\tpublic string Name { get; set; }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-dotnet/issues/comments/236671849","html_url":"https://github.com/realm/realm-dotnet/issues/514#issuecomment-236671849","issue_url":"https://api.github.com/repos/realm/realm-dotnet/issues/514","id":236671849,"user":{"login":"kristiandupont","id":847742,"avatar_url":"https://avatars.githubusercontent.com/u/847742?v=3","gravatar_id":"","url":"https://api.github.com/users/kristiandupont","html_url":"https://github.com/kristiandupont","followers_url":"https://api.github.com/users/kristiandupont/followers","following_url":"https://api.github.com/users/kristiandupont/following{/other_user}","gists_url":"https://api.github.com/users/kristiandupont/gists{/gist_id}","starred_url":"https://api.github.com/users/kristiandupont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristiandupont/subscriptions","organizations_url":"https://api.github.com/users/kristiandupont/orgs","repos_url":"https://api.github.com/users/kristiandupont/repos","events_url":"https://api.github.com/users/kristiandupont/events{/privacy}","received_events_url":"https://api.github.com/users/kristiandupont/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T18:52:01Z","updated_at":"2016-08-01T18:52:01Z","body":"The if you are running on the iOS simulator, you can keep the database open simultaneously in the [Realm Browser](https://github.com/realm/realm-browser-osx/releases). You can find the file as shown here: http://stackoverflow.com/a/28465803/1417293"}}
{"actor":{"display_login":"kristiandupont"}}