/// <inheritdoc/> protected override async Task <TUser> FindUserAsync(TKey userId, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); var user = await UsersTable.FindByIdAsync(userId); return(user); }
/// <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); }
public override async Task <ApplicationUser <TKey> > FindByIdAsync(string userId, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); if (string.IsNullOrEmpty(userId)) { throw new ArgumentException($"Parameter {nameof(userId)} cannot be null or empty."); } return(await UsersTable.FindByIdAsync(ConvertIdFromString(userId))); }
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(userId)); }
public Task <ApplicationUser> FindByIdAsync(string userId, CancellationToken cancellationToken) { bool isValidGuid = Guid.TryParse(userId, out Guid userGuid); if (!isValidGuid) { return(Task.FromResult <ApplicationUser>(null)); } cancellationToken.ThrowIfCancellationRequested(); return(_usersTable.FindByIdAsync(userGuid)); }
protected override async Task <ApplicationUser <TKey> > FindUserAsync(TKey userId, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); return(await UsersTable.FindByIdAsync(userId)); }