public virtual bool TryRemoveClaim(System.Security.Claims.Claim claim) { throw null; } public virtual void WriteTo(System.IO.BinaryWriter writer) { }
public static void ReplaceClaim(this ClaimsIdentity identity, string type, string value) { identity.TryRemoveClaim(identity.Claims.FirstOrDefault(c => c.Type == type)); identity.AddClaim(new Claim(type, value)); }