mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 FreeSql.DbContext DbSet Remove 可根据 lambda 条件删除数据的方法;
This commit is contained in:
@ -410,6 +410,16 @@ namespace FreeSql
|
||||
EnqueueToDbContext(DbContext.EntityChangeType.Delete, state);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据 lambda 条件删除数据
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public int Remove(Expression<Func<TEntity, bool>> predicate)
|
||||
{
|
||||
DbContextExecCommand();
|
||||
return this.OrmDelete(null).Where(predicate).ExecuteAffrows();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region AddOrUpdate
|
||||
|
Reference in New Issue
Block a user