public static AccountAccessConsentAggregate Create(string clientId, ICollection <string> permissions, DateTime?expirationDateTime, DateTime?transactionFromDateTime, DateTime?transactionToDateTime, string risk)
        {
            var result = new AccountAccessConsentAggregate();
            var evt    = new AccountAccessConsentAddedEvent(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 0, clientId, permissions, expirationDateTime, transactionFromDateTime, transactionToDateTime, risk);

            result.Handle(evt);
            result.DomainEvents.Add(evt);
            return(result);
        }
        public static AccountAccessConsentAggregate Build(ICollection <DomainEvent> domainEvents)
        {
            var result = new AccountAccessConsentAggregate();

            foreach (var domainEvt in domainEvents)
            {
                result.Handle(domainEvt);
            }

            return(result);
        }