public void RemoveAllowedGrantType(ClientGrantType grantType) { if (!_allowedGrantTypes.Contains(grantType)) { throw new EntityValidationException("This grant type is not currently allowed."); } var e = new RemovedAllowedGrantTypeEvent() { GrantType = grantType, ClientId = Id, OccurredOn = DateTime.UtcNow }; _changes.Add(e); EventHandler.AllowedGrantTypeRemoved(this, e); }
public static Client AllowedGrantTypeRemoved(Client client, RemovedAllowedGrantTypeEvent e) { client._allowedGrantTypes.Remove(e.GrantType); return(client); }