In my Repository
I have a method like this:
public int Delete(Expression<Func<TEntity, bool>> predicate) {
var listToDelete = UnitOfWork.Session.Query<TEntity>().Where(predicate).ToList();
foreach(var item in listToDelete)
UnitOfWork.Session.Delete(item);
return listToDelete.Count;
}
But it seems this method has not a good performance! Have you any suggestion for delete a list of objects (by a predicate) in NHibernate 3.2
please?