我有以下内容:
val.MustAsync((x, c) =>
cnx.Langs.AnyAsync(y => y.Code == x) && set.Langs.Contains(x))
但是我得到了错误:
Operator '&&' cannot be applied to operands of type 'Task<bool>' and 'bool'
如何同时使用这两种条件?
答案 0 :(得分:3)
您需要await
任务:
(await cnx.Langs.AnyAsync(y => y.Code == x)) && set.Langs.Contains(x)