public async Task RemoveClaimAsync(ApplicationRole role, Claim claim, CancellationToken cancellationToken = new CancellationToken()) { cancellationToken.ThrowIfCancellationRequested(); var deleteRoleClaimDto = new DeleteRoleClaimDto { ClaimType = claim.Type, ClaimValue = claim.Value, RoleId = role.Id }; await _roleClaimRepository.Delete(deleteRoleClaimDto); }
public async Task <int> Delete(DeleteRoleClaimDto deleteRoleClaimDto) { const string query = @" DELETE FROM [RoleClaims] WHERE [RoleId] = @RoleId AND [ClaimType] = @ClaimType AND [ClaimValue] = @ClaimValue; "; using (var connection = _dbConnectionFactory.GetDbConnection()) { var deletedRowsNum = await connection.ExecuteAsync(query, deleteRoleClaimDto); return(deletedRowsNum); } }