public void DeleteWhere(Func <Order, bool> where) { using (var session = SessionBuilder.OpenWriteSession()) { using (var transaction = session.BeginTransaction()) { try { var orders = session.Query <Order>().Where(where); foreach (var order in orders) { session.Delete(order); } transaction.Commit(); } catch (Exception) { transaction.SafeRollback(); throw; } } } }