Hum*_*Ali 0 c# linq collections
我试图在if条件下编写代码:
if (submitAnswersResponseRootObject.Response.SubmitAnswersResult.Prompts.prompt.Where(p=>p.code == 7101))
Run Code Online (Sandbox Code Playgroud)
但是我收到了错误:
无法隐式转换类型System.Collections.Generic.IEnumerable <>为bool
我究竟做错了什么?
也许Any
而不是Where
返回其他集合(过滤)?
if (submitAnswersResponseRootObject.Response.SubmitAnswersResult.Prompts.prompt.Any(p=>p.code == 7101))
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3651 次 |
最近记录: |