Example #1
0
        public Task<UserClaimDTO[]> Handle(GetAllRoleQuery request, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var Users = _UserClaimRepository.GetAll();

            return Task.FromResult(Users);
        }
        public IList <UserClaim> GetClaims(User user)
        {
            IUserClaimRepository uc_repo = _data_repository_factory.GetIdentityDataRepository <IUserClaimRepository>();
            List <UserClaim>     ucs     = new List <UserClaim>();
            var claims = uc_repo.GetAll(user.UserId);

            foreach (var ucd in claims)
            {
                ucs.Add(new UserClaim()
                {
                    UserID = ucd.UserID, ClaimID = ucd.Id, ClaimType = ucd.ClaimType, ClaimValue = ucd.ClaimValue
                });
            }
            return(ucs);
        }