Json bringing back unwanted properties

您所在的位置:网站首页 set_item_property Json bringing back unwanted properties

Json bringing back unwanted properties

2023-06-15 05:55| 来源: 网络整理| 查看: 265

That may work but remember i have multiple properties. So what i was trying to do was:

Create a class with all properties. Build a Json response Retrieve only properties that have values against them

I can achieve the above if its in a string format, if so all works as expected. The problem with string is the content-type comes back as plain-text when i need it to be Json.

For that reason i had to deserialize the string only because i wanted it to return of type application/json.

I also tried

JObject.Parse(jsonString);

Which results in the same issue (everything comes back in json format but the values are missing).

Im struggling to use JsonConvert.DeserializeAnonymousObject(jsonString) as examples around the web are different against different versions.

So even if the string output could be converted to json content type that would be ok. I will try BadRequest to see if that does anything different.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3