public async Task <IActionResult> ClientClaimDelete(ClientClaimsDto clientClaim) { await _clientService.DeleteClientClaimAsync(clientClaim); return(Success(new { Id = clientClaim.ClientId })); }
public async Task <IActionResult> UpdateClaims(int id, ClientClaimsDto input) { _repository.UpdateClaims(id, input.Claims.ToArray()); await _repository.SaveChangesAsync(); return(await GetClaims(id)); }
public async Task <IActionResult> ClientClaimDelete(ClientClaimsDto clientClaim) { await _clientService.DeleteClientClaimAsync(clientClaim); SuccessNotification(_localizer["SuccessDeleteClientClaim"], _localizer["SuccessTitle"]); return(RedirectToAction(nameof(ClientClaims), new { Id = clientClaim.ClientId })); }
public virtual async Task <int> DeleteClientClaimAsync(ClientClaimsDto clientClaim) { var clientClaimEntity = clientClaim.ToEntity(); var deleted = await ClientRepository.DeleteClientClaimAsync(clientClaimEntity); await AuditEventLogger.LogEventAsync(new ClientClaimDeletedEvent(clientClaim)); return(deleted); }
public virtual async Task <int> AddClientClaimAsync(ClientClaimsDto clientClaim) { var clientClaimEntity = clientClaim.ToEntity(); var saved = await ClientRepository.AddClientClaimAsync(clientClaim.ClientId, clientClaimEntity); await AuditEventLogger.LogEventAsync(new ClientClaimAddedEvent(clientClaim)); return(saved); }
public async Task <IActionResult> DeleteClaim(int claimId) { var clientClaimsDto = new ClientClaimsDto { ClientClaimId = claimId }; await _clientService.GetClientClaimAsync(claimId); await _clientService.DeleteClientClaimAsync(clientClaimsDto); return(Ok()); }
public async Task <IActionResult> ClientClaims(ClientClaimsDto clientClaim) { if (!ModelState.IsValid) { return(Success(clientClaim)); } await _clientService.AddClientClaimAsync(clientClaim); return(Success(new { Id = clientClaim.ClientId })); }
public async Task <IActionResult> ClientClaims(ClientClaimsDto clientClaim) { if (!ModelState.IsValid) { return(View(clientClaim)); } await _clientService.AddClientClaimAsync(clientClaim); SuccessNotification(string.Format(_localizer["SuccessAddClientClaim"], clientClaim.Value, clientClaim.ClientName), _localizer["SuccessTitle"]); return(RedirectToAction(nameof(ClientClaims), new { Id = clientClaim.ClientId })); }
public async Task <IActionResult> ClientClaimDelete(ClientClaimsDto clientClaim) { if (await IsUserManagerOrAdmin(clientClaim.ClientId)) { await _clientService.DeleteClientClaimAsync(clientClaim); SuccessNotification(_localizer["SuccessDeleteClientClaim"], _localizer["SuccessTitle"]); } else { UnauthorizedNotification(); } return(RedirectToAction(nameof(ClientClaims), new { Id = clientClaim.ClientId })); }
public static ClientClaim ToEntity(this ClientClaimsDto clientClaim, IMapper mapper) { return(mapper.Map <ClientClaim>(clientClaim)); }
public ClientClaimDeletedEvent(ClientClaimsDto clientClaim) { ClientClaim = clientClaim; }
public async Task <int> DeleteClientClaimAsync(ClientClaimsDto clientClaim) { var clientClaimEntity = clientClaim.ToEntity(); return(await _clientRepository.DeleteClientClaimAsync(clientClaimEntity)); }
public virtual async Task <int> AddClientClaimAsync(ClientClaimsDto clientClaim) { var clientClaimEntity = clientClaim.ToEntity(); return(await ClientRepository.AddClientClaimAsync(clientClaim.ClientId, clientClaimEntity)); }
public ClientClaimsRequestedEvent(ClientClaimsDto clientClaims) { ClientClaims = clientClaims; }
public ClientClaimAddedEvent(ClientClaimsDto clientClaim) { ClientClaim = clientClaim; }