Beispiel #1
0
        private async Task RemoveIndices(T user)
        {
            var userNameIndex = new UserNameIndex(user.UserName, user.Id);

            var emailIndex = new UserEmailIndex(user.Email, user.Id);

            var t1 = _identityTables.DeleteUserNamesIndexTableEntity(userNameIndex);
            var t2 = _identityTables.DeleteUserEmailsIndexTableEntity(emailIndex);

            await Task.WhenAll(t1, t2);
        }
Beispiel #2
0
        private async Task CreateEmailIndex(T user)
        {
            var emailIndex = new UserEmailIndex(user.Email, user.Id);

            try
            {
                _log.DebugFormat("Creating email index for {0}", user);
                await _identityTables.InsertUserEmailsIndexTableEntity(emailIndex);
            }
            catch (StorageException ex)
            {
                if (ex.RequestInformation.HttpStatusCode == 409)
                {
                    throw new DuplicateEmailException();
                }
                _log.Error(ex.Message, ex);
                throw;
            }
        }
 public async Task <UserEmailIndex> RetrieveUserEmailsIndexAsync(UserEmailIndex entity)
 {
     return(await RetrieveAsync(_userEmailsIndexTable, entity));
 }
 public Task <TableResult> DeleteUserEmailsIndexTableEntity(UserEmailIndex entity)
 {
     return(DeleteAsync(_userEmailsIndexTable, entity));
 }
 public Task <TableResult> InsertUserEmailsIndexTableEntity(UserEmailIndex entity)
 {
     return(InsertAsync(_userEmailsIndexTable, entity));
 }