Exemple #1
0
        public override async Task <IdentityResult> CreateAsync(ApplicationUser <TKey> user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            user.ThrowIfNull(nameof(user));

            return(await UsersTable.CreateAsync(user));
        }
Exemple #2
0
        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));
        }
Exemple #3
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."
            }));
        }
Exemple #4
0
        /// <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));
        }
Exemple #5
0
 public Task <IdentityResult> CreateAsync(ApplicationUser user, CancellationToken cancellationToken = default)
 {
     cancellationToken.ThrowIfCancellationRequested();
     user.ThrowIfNull(nameof(user));
     return(_usersTable.CreateAsync(user));
 }