public async Task Notify(DeleteRuoliUtenteCommand command) { var utente = _getUtenteByCF.Get(command.CodFiscale); await _notificationHubContext.Clients.Group(utente.Sede.Codice).SendAsync("NotifyRefreshUtenti", true).ConfigureAwait(false); await _notificationHubContext.Clients.Group(utente.Sede.Codice).SendAsync("NotifyModificatoRuoloUtente", utente).ConfigureAwait(false); }
public IActionResult DeleteRuolo(DeleteRuoliUtenteCommand command) { command.CodiceSede = Request.Headers["codiceSede"]; try { _deleteRuoliCommand.Handle(command); return(Ok()); } catch (System.Exception ex) { if (ex.Message.Contains(Costanti.UtenteNonAutorizzato)) { return(StatusCode(403, Costanti.UtenteNonAutorizzato)); } return(BadRequest()); } }