How can I extract data from this Json column without using a big function ,just using simple query
如何在不使用大函数的情况下从这个Json列中提取数据,只需使用简单查询
I want to extract value "Hospitality" from mypropertytype
我想从mypropertytype中提取值“Hospitality”
Example:
[{"myPropertyType":{"code":"9","name":"Hospitality"},"myPropertySubType":{"code":"901","name":"Hotel"},"yourPropertyType":{"code":"9","name":"Hospitality"},"yourPropertySubType":{"code":"901","name":"Hotel"}}]
1 个解决方案
#1
0
Using the package Newtonsoft.Json
you can deserialize any JSON into a class.
使用Newtonsoft.Json包可以将任何JSON反序列化为类。
class MyPropertyType {
int code { get; set; }
string name { get; set; }
}
JsonConvert.DeserializeObject<IList<MyPropertyType>>(sqlJsonString);
#1
0
Using the package Newtonsoft.Json
you can deserialize any JSON into a class.
使用Newtonsoft.Json包可以将任何JSON反序列化为类。
class MyPropertyType {
int code { get; set; }
string name { get; set; }
}
JsonConvert.DeserializeObject<IList<MyPropertyType>>(sqlJsonString);