Question: In c# im trying to dynamically access a value in a json object it works if I chance the if statement to look like if(json.dog==
In c# im trying to dynamically access a value in a json object it works if I chance the if statement to look like if(json.dog== "corgi") but I cant get it to dynamically map into the type. Ive tried : if(json + "." + type) but it didnt map correctly.
THE CODE:
dynamic json= json object
string type = dog;
public void fcn2(dynamic json, string type){
if(json.type == "corgi"){
}
If you could help it would be much appreciated!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
