public override async Task <IdentityResult> CreateAsync(ApplicationUser <TKey> user, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); user.ThrowIfNull(nameof(user)); return(await UsersTable.CreateAsync(user)); }
public Task <IdentityResult> CreateAsync(ApplicationUser user, CancellationToken cancellationToken) { if (user == null) { throw new ArgumentNullException(nameof(user), "Parameter user is not set to an instance of an object."); } return(_usersTable.CreateAsync(user, cancellationToken)); }
/// <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." })); }
/// <summary> /// /// </summary> /// <param name="user"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public virtual Task <IdentityResult> CreateAsync(ApplicationUser user, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); user.ThrowIfNull(nameof(user)); user.CreatedDate = DateTime.UtcNow; user.ModifiedDate = DateTime.UtcNow; user.RecordStatus = RecordStatus.NewMode; user.Status = true; user.Trashed = false; user.ModifiedBy = user.CreatedBy; return(_usersTable.CreateAsync(user)); }
public Task <IdentityResult> CreateAsync(ApplicationUser user, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); user.ThrowIfNull(nameof(user)); return(_usersTable.CreateAsync(user)); }