private List <CheckboxViewModel> GetClaimsCheckboxViewModel(Claim permissionClaims = null)
 {
     return((from itm in _claimService.GetAllClaims()
             select new CheckboxViewModel
     {
         Checked = permissionClaims.HasPermissionClaim(itm.Value),
         Value = itm.Value,
         Text = itm.Value
     })?.ToList());
 }
 private List <CheckboxViewModel> GetClaimsCheckboxViewModel(IEnumerable <Claim> currentClaims = null)
 {
     return((from itm in _claimService.GetAllClaims()
             select new CheckboxViewModel
     {
         Checked = (currentClaims ?? new Claim[] { }).Any(currentClaim => currentClaim.Type.Equals(itm.Type) && currentClaim.Value.Equals(itm.Value)),
         Value = itm.Value,
         Text = itm.Value
     })?.ToList());
 }
        public IActionResult Index()
        {
            IEnumerable <ClaimViewModel> coll = from itm in _claimService.GetAllClaims()
                                                select new ClaimViewModel
            {
                Key           = itm.Key,
                Value         = itm.Value,
                OwnerIdentity = itm.OwnerIdentity,
                OwnerIp       = itm.OwnerIP
            };

            return(View(coll));
        }
Exemple #4
0
 public async Task <ActionResult> Index()
 {
     return(View(await _claimService.GetAllClaims()));
 }