Пример #1
0
        public async Task Notify(AddRuoliUtenteCommand 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);
        }
Пример #2
0
 public IActionResult AddRuolo(AddRuoliUtenteCommand command)
 {
     command.CodiceSede = Request.Headers["codiceSede"];
     try
     {
         _addRuoliCommand.Handle(command);
         return(Ok());
     }
     catch (System.Exception ex)
     {
         if (ex.Message.Contains(Costanti.UtenteNonAutorizzato))
         {
             return(StatusCode(403, Costanti.UtenteNonAutorizzato));
         }
         return(BadRequest());
     }
 }