public async Task <IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); if (user == null) { throw new ArgumentNullException(nameof(user)); } cancellationToken.ThrowIfCancellationRequested(); TableOperation executeOperation = TableOperation.Delete(user); try { TableResult result = await AuthCloudTable.ExecuteAsync(executeOperation, cancellationToken); } catch (Exception ex) { throw new Exception($"Failed deleting user {user.RowKey}", ex); } return(IdentityResult.Success); }
public async Task <IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (user == null) { throw new ArgumentNullException(nameof(user)); } cancellationToken.ThrowIfCancellationRequested(); TableOperation executeOperation = TableOperation.Replace(user); try { await AuthCloudTable.ExecuteAsync(executeOperation, cancellationToken); } catch (Exception ex) { throw new Exception(ex.Message, ex); } return(IdentityResult.Success); }