I'm working on a Blazor application and I have a Json string from which I'm trying to extract a value.
Json Data looks like this:
{"a1":"a1234","e1":"e1234}
I'm trying to extract the a1
value from this which is "a1234"
My JSON Data is in a string variable, rawJsonData
. I'm trying to use the JsonSerializer.Deserialize, but I'm not sure how to completely use it...
@code
{
string rawJsonData = JsonData (this is not the actual data, it's being pulled from elsewhere)
var x = System.Text.Json.JsonSerializer.Deserialize<???>(rawJsonData)
}
is this the right way to approach this? I'm not sure what to put in place of ??? above. Anyone has experience with this.