public void RemoveAllowedIdentity(Identity identity) { if (!_allowedIdentities.Contains(identity)) { throw new EntityValidationException("This identity is not currently allowed."); } var e = new RemovedAllowedIdentityEvent() { Identity = identity, ClientId = Id, OccurredOn = DateTime.UtcNow }; _changes.Add(e); EventHandler.AllowedIdentityRemoved(this, e); }
public static Client AllowedIdentityRemoved(Client client, RemovedAllowedIdentityEvent e) { client._allowedIdentities.Remove(e.Identity); return(client); }