Пример #1
0
        /// <summary>
        /// 保存用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task <IdentityResult> CreateAsync(SysUser user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();

            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            await _db.AddAsync(user);

            await _db.SaveChangesAsync(cancellationToken);

            return(IdentityResult.Success);
        }