public async Task <IActionResult> OnPostGetUserRoleAsync(string UtenteRuoloId) { if (!string.IsNullOrWhiteSpace(UtenteRuoloId)) { Utenti utente = _db.Utenti.Where(u => u.Id.Equals(UtenteRuoloId, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); RuoliDiUtente = await _userManager.GetRolesAsync(utente); if (RuoliDiUtente.Count == 0) { RuoliDiUtente = null; HasRuolo = -1; } return(Page()); } return(Page()); }