You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this library and receiving data from a call, I want to know how I'm expected to put the data into models that can be used in my application. With the approach I've been taking I've run into some issues, and I can't find anything in the documentation that indicates how a user of this library might expect to process the data they receive.
I'm using the untyped syntax to get data from a set of endpoints on a FROST server implementing SensorThings and my models have constructors that take an IDictionary<string, object> as a parameter. In those constructors, I use the .TryGetValue() method from IDictionary for each property of the received data to find the key-value pair with the right key and assign its value to the corresponding property in the model. When I had trouble with some nested properties stored on the server as JSONb that contain arrays, I had some success turning to JSON serialization and deserialization to handle those. I wonder if this use of the JSON library would be a better way to handle all of the data, but I don't know enough about that library to move forward with that yet.
I'd like to hear what the people behind this library might have expected should be built for using this library, or what they might already have done to that end. I'd also love hearing from anyone else who has faced and/or answered this question themselves.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When using this library and receiving data from a call, I want to know how I'm expected to put the data into models that can be used in my application. With the approach I've been taking I've run into some issues, and I can't find anything in the documentation that indicates how a user of this library might expect to process the data they receive.
I'm using the untyped syntax to get data from a set of endpoints on a FROST server implementing SensorThings and my models have constructors that take an
IDictionary<string, object>
as a parameter. In those constructors, I use the.TryGetValue()
method fromIDictionary
for each property of the received data to find the key-value pair with the right key and assign its value to the corresponding property in the model. When I had trouble with some nested properties stored on the server as JSONb that contain arrays, I had some success turning to JSON serialization and deserialization to handle those. I wonder if this use of the JSON library would be a better way to handle all of the data, but I don't know enough about that library to move forward with that yet.I'd like to hear what the people behind this library might have expected should be built for using this library, or what they might already have done to that end. I'd also love hearing from anyone else who has faced and/or answered this question themselves.
Beta Was this translation helpful? Give feedback.
All reactions