Beispiel #1
0
        public async Task <IEnumerable <PendingAccountDto> > GetPendingAccountsForBusinessAsync(Guid businessId)
        {
            var accounts = await _pendingIdentityRepository.GetForBusinessAsync(businessId);

            var ret = new List <PendingAccountDto>();

            foreach (var pendingIdentity in accounts)
            {
                ret.Add(new PendingAccountDto
                {
                    Id           = pendingIdentity.Id,
                    EmailAddress = pendingIdentity.Email
                });
            }

            return(ret);
        }
        public async Task <IEnumerable <AccountInfoDto> > HandleAsync(GetAllBusinessAdmins query)
        {
            var accounts = new List <AccountInfoDto>();

            var pending = await _pendingRepository.GetForBusinessAsync(query.BusinessId);

            var identities = await _identityRepository.GetAdminsForBusinessAsync(query.BusinessId);

            foreach (var pendingIdentity in pending)
            {
                accounts.Add(new AccountInfoDto {
                    Email = pendingIdentity.Email, Id = pendingIdentity.Id, IsPending = true
                });
            }

            foreach (var identity in identities)
            {
                accounts.Add(new AccountInfoDto {
                    Email = identity.Email, Id = identity.Id, IsPending = false, CreatedOn = identity.CreatedOn
                });
            }

            return(accounts);
        }