public async Task <IEnumerable <AdminUserViewModel> > GetActiveAdminUsers(int currentUserId, string role) { _logger.LogInfo("Role " + role + " is trying to get all active admins"); try { IEnumerable <AdminUserViewModel> adminUser = _mapper.Map <IEnumerable <AdminUser>, IEnumerable <AdminUserViewModel> >(await _adminUserRepo.GetActiveAdminUsers(currentUserId, role)); _logger.LogInfo("Fetched active admins for role " + role); return(adminUser); } catch (Exception ex) { _logger.LogError(ex.Message); return(null); } }