Exemplo n.º 1
0
        public async Task AddToRoleAsync(IdentityUser user, string roleName, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            try
            {
                var result = await _userRepository.AddToRoleAsync(user.Id, roleName, cancellationToken);
            }
            catch (Exception ex)
            {
                Logging.LogException(ex);
            }
        }