public async Task Notify(DeleteUtenteCommand command) { await _notificationHubContext.Clients.Group(command.CodiceSede).SendAsync("NotifyRefreshUtenti", true); await _notificationHubContext.Clients.Group(command.UtenteRimosso.Sede.Codice).SendAsync("NotifyRefreshUtenti", true); await _notificationHubContext.Clients.Group(command.UtenteRimosso.Sede.Codice).SendAsync("NotifyDeleteUtente", command.UtenteRimosso.Id); }
public IActionResult DeleteUtente([FromBody] DeleteUtenteCommand command) { command.CodiceSede = Request.Headers["codiceSede"]; try { _deleteUtenteCommand.Handle(command); return(Ok()); } catch (System.Exception ex) { if (ex.Message.Contains(Costanti.UtenteNonAutorizzato)) { return(StatusCode(403, Costanti.UtenteNonAutorizzato)); } return(BadRequest()); } }
public async Task Notify(DeleteUtenteCommand command) { await _notificationHubContext.Clients.All.SendAsync("NotifyDeleteUtente", command.UtenteRimosso.Id); }