public async Task <IList <string> > GetRolesAsync(IdentityUser user, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (user == null) { throw new ArgumentNullException(nameof(user)); } try { var result = await _userRepository.GetRolesByUserIdAsync(user.Id); return(result); } catch (Exception ex) { Logging.LogException(ex); return(null); } }