0

How could I get a list of users by the claims they have? I have tried the following query on the UserManager.Users property of IQueryable

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

This returns no results. Is my query formed wrong? I am using Web.Api v2.2

MiddleTommy
  • 359
  • 3
  • 10

1 Answers1

0

Nevermind it Works like this

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

MiddleTommy
  • 359
  • 3
  • 10