public void DeleteAsync <TEntity>(Expression <Func <TEntity, bool> > filter) where TEntity : class { SqlStatement = filter.ToString(); switch (DataBaseType) { case DataBaseType.MongoDB: GetCollectionEntity <TEntity>().DeleteManyAsync(filter); break; default: break; } DbCacheManager.Delete(this, filter); }
public override async Task <int> DeleteAsync <TEntity>(TEntity entity) { this.Parameters.Clear(); this.ConnectionManager.SetConnectionString(OperationType.Write); this.DbConnection = this.GetDbConnection(this.ConnectionManager.CurrentConnectionString); this.DbCommand.Connection = this.DbConnection; this.DbCommand.CommandType = CommandType.Text; this.CommandTextGenerator.Delete(entity); this.TableName = GetTableName <TEntity>(); this.DBTransaction.SyncCommandTransaction(); int res = await this.QueryExecutor.ExecuteNonQueryAsync(this); DbCacheManager.Delete(entity); return(res); }
public override int Delete <TEntity>(Expression <Func <TEntity, bool> > filter) { this.Parameters.Clear(); this.ConnectionManager.SetConnectionString(OperationType.Write); this.DbConnection = this.GetDbConnection(this.ConnectionManager.CurrentConnectionString); this.DbCommand.Connection = this.DbConnection; this.DbCommand.CommandType = CommandType.Text; this.CommandTextGenerator.Delete(filter); this.TableName = GetTableName <TEntity>(); this.DBTransaction.SyncCommandTransaction(); int res = this.QueryExecutor.ExecuteNonQuery(this); DbCacheManager.Delete(filter); return(res); }
public void DeleteAsync <TEntity>(Expression <Func <TEntity, bool> > filter) where TEntity : class { SqlGenerator.Delete(this, filter); DbHelper.ExecuteNonQueryAsync(SqlStatement); DbCacheManager.Delete(this, filter); }
public override async Task DeleteAsync <TEntity>(Expression <Func <TEntity, bool> > filter) { await GetCollectionEntity <TEntity>().DeleteManyAsync(filter); DbCacheManager.Delete(filter); }
public override void Delete <TEntity>(Expression <Func <TEntity, bool> > filter) { GetCollectionEntity <TEntity>().DeleteMany(filter); DbCacheManager.Delete(filter); }
public async Task DeleteOneAsync <TEntity>(Expression <Func <TEntity, bool> > filter) where TEntity : class { await GetCollectionEntity <TEntity>().DeleteOneAsync(filter); DbCacheManager.Delete(filter); }
public void DeleteOne <TEntity>(Expression <Func <TEntity, bool> > filter) where TEntity : class { GetCollectionEntity <TEntity>().DeleteOne(filter); DbCacheManager.Delete(filter); }