Esempio n. 1
0
        public override async Task <IList <string> > GetRolesAsync(User user,
                                                                   CancellationToken cancellationToken = default)
        {
            cancellationToken.ThrowIfCancellationRequested();
            var result = await _usersRoles.GetRolesAsync(user.Id, _roles, cancellationToken);

            return(result.Select(x => x.Name).ToList());
        }
Esempio n. 2
0
        public Task <IList <string> > GetRolesAsync(BL.Models.User user, CancellationToken cancellationToken)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user), "Parameter user is not set to an instance of an object.");
            }

            return(_usersRolesRepository.GetRolesAsync(_mapper.Map <DL.Models.User>(user), cancellationToken));
        }
Esempio n. 3
0
        public Task <IList <string> > GetRolesAsync(User user, CancellationToken cancellationToken)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user), "Parameter user is not set to an instance of an object.");
            }

            var roles = _usersRolesRepository.GetRolesAsync(user, cancellationToken);

            return(roles);
        }