Exemplo n.º 1
0
        public async Task <IdentityResult> CreateAsync(Employee employee, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            if (employee == null)
            {
                throw new ArgumentNullException(nameof(employee));
            }

            db.Add(employee);

            await db.SaveChangesAsync(cancellationToken);

            return(await Task.FromResult(IdentityResult.Success));
        }
Exemplo n.º 2
0
        public async Task <IdentityResult> CreateAsync(Role role, CancellationToken cancellationToken)
        {
            db.Add(role);

            await db.SaveChangesAsync(cancellationToken);

            return(await Task.FromResult(IdentityResult.Success));
        }