How to delete all records by IRepository<T>?

Topics: Core, General
May 26, 2014 at 10:00 AM
I have table with log records. I need to delete all records from this table by button in dashboard.
How to do this?
Now I see only this way, but it looks ugly:
var itemsToDelete = _repository.Table.Take(1000);

while (itemsToDelete.Any())
    foreach (var item in itemsToDelete)
    itemsToDelete = _repository.Table.Take(1000);
May 26, 2014 at 3:36 PM
Unfortunately there is no other way using the repository. You write HQL directly through the NHibernate ISession (inject ISessionLocator) directly though.