public override void Delete(Account account)
        {
            var eventStore = new EventStore()
              {
            Date = DateTime.UtcNow,
            EventName = Events.DeleteAccount,
            Payload = account
              };

              this.eventStoreRepository.Add(eventStore);
              this.AccountRepository.Delete(account);
        }
        public override void Delete(Query query)
        {
            var eventStore = new EventStore()
              {
            Date = DateTime.UtcNow,
            EventName = Events.DeleteAccount,
            Payload = query
              };

              this.eventStoreRepository.Add(eventStore);
              this.QueryRepository.Delete(query);
        }
        public override Account Save(Account account)
        {
            var newAccount = account.Id == null;

              Account accountResult = this.AccountRepository.Save(account);

              var eventStore = new EventStore()
              {
            Date = DateTime.UtcNow,
            EventName = newAccount ? Events.CreateAccount : Events.UpdateAccount,
            Payload = account
              };

              if (newAccount)
              {
            this.eventStoreRepository.Add(eventStore);
              }
              else
              {
            this.eventStoreRepository.Add(eventStore);
              }

              return accountResult;
        }
        public override Query Save(Query query)
        {
            var isNewQuery = query.Id == null;

              var queryResult = this.QueryRepository.Save(query);

              var eventStore = new EventStore()
              {
            Date = DateTime.UtcNow,
            EventName = isNewQuery ? Events.CreateAccount : Events.UpdateAccount,
            Payload = queryResult
              };

              if (isNewQuery)
              {
            this.eventStoreRepository.Add(eventStore);
              }
              else
              {
            this.eventStoreRepository.Add(eventStore);
              }

              return queryResult;
        }