Example #1
0
        public void BulkDelete(Expression <Func <T, bool> > expression)
        {
            try
            {
                if (expression == null)
                {
                    throw new ArgumentNullException(nameof(expression));
                }

                using (var tx = TransactionExtensions.CreateTransactionScope())
                {
                    _dbSet.Where(expression)
                    .DeleteFromQuery();
                    tx.Complete();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }