예제 #1
0
 /// <inheritdoc/>
 public override Task <IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     ThrowIfDisposed();
     user.ThrowIfNull(nameof(user));
     return(UsersTable.CreateAsync(user));
 }
예제 #2
0
        /// <inheritdoc/>
        public override async Task <IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            user.ThrowIfNull(nameof(user));
            var created = await UsersTable.CreateAsync(user);

            return(created ? IdentityResult.Success : IdentityResult.Failed(new IdentityError {
                Code = string.Empty,
                Description = $"User '{user.UserName}' could not be created."
            }));
        }
예제 #3
0
 public Task <IdentityResult> CreateAsync(ApplicationUser user, CancellationToken cancellationToken = default(CancellationToken))
 {
     cancellationToken.ThrowIfCancellationRequested();
     user.ThrowIfNull(nameof(user));
     return(_usersTable.CreateAsync(user));
 }