예제 #1
0
 /// <summary>
 /// Delete
 /// 根据条件删除。
 /// </summary>
 /// <typeparam name="TEntity">类型参数</typeparam>
 /// <param name="connection">DbConnection</param>
 /// <param name="predicate">表达式目录树</param>
 /// <param name="transaction">事务</param>
 /// <returns>bool</returns>
 public static bool Delete <TEntity>(this IDbConnection connection, Expression <Func <TEntity, bool> > predicate, IDbTransaction transaction = null)
 {
     try
     {
         return(DommelMapper.DeleteMultiple <TEntity>(connection, predicate, transaction));
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }