예제 #1
0
        public async Task <IdentityResult> DeleteAsync(Employee employee, CancellationToken cancellationToken)
        {
            db.Remove(employee);

            int i = await db.SaveChangesAsync(cancellationToken); // return code

            return(await Task.FromResult(i == 1?IdentityResult.Success : IdentityResult.Failed()));
        }
예제 #2
0
        public async Task <IdentityResult> DeleteAsync(Role role, CancellationToken cancellationToken)
        {
            db.Remove(role);

            int i = await db.SaveChangesAsync(cancellationToken);

            return(await Task.FromResult(i == 1?IdentityResult.Success : IdentityResult.Failed()));
        }