mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 BaseEntity 物理删除方法 Delete(true);#152
- 修复 Sqlite attachs 附加数据库别名 bug;
This commit is contained in:
@ -62,8 +62,17 @@ namespace FreeSql
|
||||
/// <summary>
|
||||
/// 删除数据
|
||||
/// </summary>
|
||||
/// <param name="physicalDelete">是否物理删除</param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<bool> DeleteAsync() => this.UpdateIsDeletedAsync(true);
|
||||
async public virtual Task<bool> DeleteAsync(bool physicalDelete = false)
|
||||
{
|
||||
if (physicalDelete == false) return await this.UpdateIsDeletedAsync(true);
|
||||
if (this.Repository == null)
|
||||
return await Orm.Delete<TEntity>(this as TEntity).ExecuteAffrowsAsync() == 1;
|
||||
//this.SetTenantId();
|
||||
this.Repository.UnitOfWork = UnitOfWork.Current.Value;
|
||||
return await this.Repository.DeleteAsync(this as TEntity) == 1;
|
||||
}
|
||||
/// <summary>
|
||||
/// 恢复删除的数据
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user