diff --git a/src/InterfaceForward.Application/Services/App/AppsService.cs b/src/InterfaceForward.Application/Services/App/AppsService.cs index 406862b..4876914 100644 --- a/src/InterfaceForward.Application/Services/App/AppsService.cs +++ b/src/InterfaceForward.Application/Services/App/AppsService.cs @@ -134,7 +134,7 @@ public class AppsService : ApplicationService var res = await _appRepository.AsQueryable() .Select(x => new AppOutput { Id = x.Id.SelectAll() }) .SingleAsync(x => x.Id == id); - _ = res ?? throw new BusinessException(message:"在指定的编号下找不到数据"); + _ = res ?? throw new BusinessException(message: "在指定的编号下找不到数据"); // if (res.LogoKey != null) res.LogoUrl = OSSHelper.GetUrlByKey(res.LogoKey); res.AppScope = await _appScopeRepository.AsQueryable() @@ -221,8 +221,8 @@ public class AppsService : ApplicationService item.InterfaceCode = interfaceDic[item.InterfaceId]; }); - await _appScopeRepository.UpdateAsync(x => new AppScopeEntity { IsDeleted = true }, - x => x.AppId == input.Id); + await _appScopeRepository.AsUpdateable().SetColumns(x => x.IsDeleted == true) + .Where(x => x.AppId == input.Id).ExecuteCommandAsync(); await _appScopeRepository.InsertRangeAsync(appScopeEntitys); ts.Complete(); diff --git a/src/InterfaceForward.Repositories/App/Services/AppScopeRepository.cs b/src/InterfaceForward.Repositories/App/Services/AppScopeRepository.cs index 5e4f63c..42fb96e 100644 --- a/src/InterfaceForward.Repositories/App/Services/AppScopeRepository.cs +++ b/src/InterfaceForward.Repositories/App/Services/AppScopeRepository.cs @@ -9,11 +9,6 @@ namespace InterfaceForward.Repositories.App.Services /// public class AppScopeRepository : BasicRepository, IAppScopeRepository, IScopedDependency { - public Task UpdateAsync(Expression> columns, Expression> whereExpression) - { - return Context.Updateable().Where(whereExpression).UpdateColumns(columns).ExecuteCommandHasChangeAsync(); - } - public IUpdateable AsUpdateable() { return Context.Updateable(); diff --git a/src/InterfaceForward.Repositories/App/Services/IAppScopeRepository.cs b/src/InterfaceForward.Repositories/App/Services/IAppScopeRepository.cs index 5d054aa..ae683fc 100644 --- a/src/InterfaceForward.Repositories/App/Services/IAppScopeRepository.cs +++ b/src/InterfaceForward.Repositories/App/Services/IAppScopeRepository.cs @@ -8,8 +8,6 @@ namespace InterfaceForward.Repositories.App.Services /// public interface IAppScopeRepository { - Task UpdateAsync(Expression> columns, Expression> whereExpression); - ISugarQueryable AsQueryable(); Task InsertRangeAsync(List insertObjs);