Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public static Client AllowedGrantTypeRemoved(Client client, RemovedAllowedGrantTypeEvent e)
 {
     client._allowedGrantTypes.Remove(e.GrantType);
     return(client);
 }