¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Trouble with Newtonsoft


 
Edited

You can still deserialize to the type you want without having to create another class by selecting the internal object.

var acStateObject = JObject.Parse(inputJson);
JToken acStateToken = acStateObject["acState"];
return acStateToken?.ToObject<acState>();
?
By the way, you really should be using proper C# naming conventions. This is why the Newtonsoft library has attribute classes that allow you to specify how the JSON keys are named, so that you don't need to name the identifiers in the same way.

--
?
Crestron Service Provider - TBD Enterprises Inc.

Join [email protected] to automatically receive all group messages.