如果可能的话,我试图弄清楚如何检查对象是否包含特定值。
我的对象内容列表如下:
[{
"TypeId": 1,
"Content": "Some content here"
},
{
"TypeId": 2,
"Content": "Some new content here"
},
{
"TypeId": 4,
"Content": "Some other content here"
}]
现在,我想做的是搜索这样的东西:
if(commentsList.Contains(4))
我想检查 commentsList 是否有一个 TypeId 为 4 的对象。
这可以做到吗?
任何帮助表示赞赏并提前感谢:-)