0

我如何通过他们拥有的声明获得用户列表?我在 IQueryable 的 UserManager.Users 属性上尝试了以下查询

await (from t in Users
from c in t.Claims
where c.ClaimType == "CompanyId" && c.ClaimValue == Id
select t).Execute();

这不返回任何结果。我的查询是错误的吗?我正在使用 Web.Api v2.2

4

1 回答 1

0

没关系它像这样工作

var q = from t in Users where t.Claims.Any(c => c.ClaimType == Claims.CompanyId && c.ClaimValue == cid) select t; var users = q.ToList();

于 2015-07-01T19:00:47.990 回答