public async Task <bool> RemoveAsync(Guid id) { try { var userToRemove = await _context.User.SingleOrDefaultAsync(u => u.SubjectId == id); _context.Remove(userToRemove); await _context.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public async Task <int> Remove <T>(Guid id) where T : BaseEntity { _dbContext.Remove(_dbContext.Set <T>().Find(id)); return(dbContextTransaction == null ? await CommitTrans() : 0); }