Exemplo n.º 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);
        }
Exemplo n.º 2
0
        private async Task CreateUserNameIndex(T user)
        {
            var userNameIndex = new UserNameIndex(user.UserName, user.Id);

            try
            {
                _log.DebugFormat("Creating username index for {0}", user);
                await _identityTables.InsertUserNamesIndexTableEntity(userNameIndex);
            }
            catch (StorageException ex)
            {
                if (ex.RequestInformation.HttpStatusCode == 409)
                {
                    throw new DuplicateUsernameException();
                }
                _log.Error(ex.Message, ex);
                throw;
            }
        }
 public async Task <UserNameIndex> RetrieveUserNamesIndexAsync(UserNameIndex entity)
 {
     return(await RetrieveAsync(_userNamesIndexTable, entity));
 }
 public Task <TableResult> DeleteUserNamesIndexTableEntity(UserNameIndex entity)
 {
     return(DeleteAsync(_userNamesIndexTable, entity));
 }
 public Task <TableResult> InsertUserNamesIndexTableEntity(UserNameIndex entity)
 {
     return(InsertAsync(_userNamesIndexTable, entity));
 }