fix app update bug

This commit is contained in:
xiaolipro 2025-10-14 09:59:48 +08:00
parent 498605fce0
commit fe2b26c76c
3 changed files with 3 additions and 10 deletions

View File

@ -221,8 +221,8 @@ public class AppsService : ApplicationService
item.InterfaceCode = interfaceDic[item.InterfaceId]; item.InterfaceCode = interfaceDic[item.InterfaceId];
}); });
await _appScopeRepository.UpdateAsync(x => new AppScopeEntity { IsDeleted = true }, await _appScopeRepository.AsUpdateable().SetColumns(x => x.IsDeleted == true)
x => x.AppId == input.Id); .Where(x => x.AppId == input.Id).ExecuteCommandAsync();
await _appScopeRepository.InsertRangeAsync(appScopeEntitys); await _appScopeRepository.InsertRangeAsync(appScopeEntitys);
ts.Complete(); ts.Complete();

View File

@ -9,11 +9,6 @@ namespace InterfaceForward.Repositories.App.Services
/// </summary> /// </summary>
public class AppScopeRepository : BasicRepository<AppScopeEntity>, IAppScopeRepository, IScopedDependency public class AppScopeRepository : BasicRepository<AppScopeEntity>, IAppScopeRepository, IScopedDependency
{ {
public Task<bool> UpdateAsync(Expression<Func<AppScopeEntity, object>> columns, Expression<Func<AppScopeEntity, bool>> whereExpression)
{
return Context.Updateable<AppScopeEntity>().Where(whereExpression).UpdateColumns(columns).ExecuteCommandHasChangeAsync();
}
public IUpdateable<AppScopeEntity> AsUpdateable() public IUpdateable<AppScopeEntity> AsUpdateable()
{ {
return Context.Updateable<AppScopeEntity>(); return Context.Updateable<AppScopeEntity>();

View File

@ -8,8 +8,6 @@ namespace InterfaceForward.Repositories.App.Services
/// </summary> /// </summary>
public interface IAppScopeRepository public interface IAppScopeRepository
{ {
Task<bool> UpdateAsync(Expression<Func<AppScopeEntity, object>> columns, Expression<Func<AppScopeEntity, bool>> whereExpression);
ISugarQueryable<AppScopeEntity> AsQueryable(); ISugarQueryable<AppScopeEntity> AsQueryable();
Task<bool> InsertRangeAsync(List<AppScopeEntity> insertObjs); Task<bool> InsertRangeAsync(List<AppScopeEntity> insertObjs);