public void AddAllowedGrantType(ClientGrantType grantType) { if (_allowedGrantTypes.Contains(grantType)) { throw new EntityValidationException("This grant type is already allowed."); } var e = new AddedAllowedGrantTypeEvent() { GrantType = grantType, ClientId = Id, OccurredOn = DateTime.UtcNow }; _changes.Add(e); EventHandler.AllowedGrantTypeAdded(this, e); }
public static Client AllowedGrantTypeAdded(Client client, AddedAllowedGrantTypeEvent e) { client._allowedGrantTypes.Add(e.GrantType); return(client); }