/// <summary> /// 内部方法,sql不处理 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="entityToDelete"></param> /// <returns></returns> public bool Delete <T>(T entityToDelete) where T : class { if (CurrentTransaction != null) { return(CurrentConnection.Delete <T>(entityToDelete, CurrentTransaction, CommandTimeout)); } using var connection = GetDbConnection(DataSourceEnum.MASTER); return(connection.Delete <T>(entityToDelete, CurrentTransaction, CommandTimeout)); }
/// <summary> /// 删除记录 /// </summary> /// <returns>操作是否成功</returns> /// <param name="entity">需要操作的实体类.</param> public bool Delete <T>(T entity) where T : ModelBase { return(CurrentConnection.Delete <T>(entity)); }