Exemplo n.º 1
0
        /// <inheritdoc/>
        protected override async Task <TUser> FindUserAsync(TKey userId, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            var user = await UsersTable.FindByIdAsync(userId);

            return(user);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override async Task <TUser> FindByIdAsync(string userId, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            var id   = ConvertIdFromString(userId);
            var user = await UsersTable.FindByIdAsync(id);

            return(user);
        }
Exemplo n.º 3
0
        public Task <ApplicationUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            var isValidGuid = Guid.TryParse(userId, out var userGuid);

            if (!isValidGuid)
            {
                return(Task.FromResult <ApplicationUser>(null));
            }

            return(_usersTable.FindByIdAsync(userGuid));
        }