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())); }
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())); }