I was wondering if there is a method in order to remove duplicate from claims
this is my extract code:
 var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
foreach (Delegation d in delegations)
{
List<string> delegateRoles = await (from r in _dbContext.Roles 
                             where (del.DelegatedId == user.UserId)
                             select r.RoleName).Distinct().ToListAsync();
foreach (string role in delegateRoles)
{
   if (DelegatorUserRoles.Contains(role))
   {
      identity.AddClaim(new Claim("DelegatedRole", role));
                         
    }
}
}
The problem is that I can have multiple delegations with the same roles, so I want to delete duplicates
