perf: 子模块更新

This commit is contained in:
tk 2024-12-31 15:56:36 +08:00 committed by nsnail
parent a2de0bcbd1
commit ddac448087
8 changed files with 10 additions and 8 deletions

View File

@ -80,7 +80,7 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
// 默认匹配主键 // 默认匹配主键
whereExp ??= a => a.Id.Equals(newValue.Id); whereExp ??= a => a.Id.Equals(newValue.Id);
var update = BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).Where(whereSql); var update = BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).Where(whereSql);
return update.ExecuteAffrowsAsync(); return update.ExecuteEffectsAsync();
} }
#if DBTYPE_SQLSERVER #if DBTYPE_SQLSERVER

View File

@ -1,3 +1,5 @@
using FreeSql.Provider.SqlServer;
namespace NetAdmin.Domain.Extensions; namespace NetAdmin.Domain.Extensions;
/// <summary> /// <summary>

View File

@ -3,8 +3,8 @@
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/> <Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
<Import Project="$(SolutionDir)/build/prebuild.targets"/> <Import Project="$(SolutionDir)/build/prebuild.targets"/>
<ItemGroup> <ItemGroup>
<PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.0.14" Label="refs"/> <PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.0.17" Label="refs"/>
<PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.0.14" Label="refs"/> <PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.0.17" Label="refs"/>
<PackageReference Include="Gurion" Version="1.2.7" Label="refs"/> <PackageReference Include="Gurion" Version="1.2.7" Label="refs"/>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0"/> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0"/>
<PackageReference Include="Minio" Version="6.0.4"/> <PackageReference Include="Minio" Version="6.0.4"/>

View File

@ -97,7 +97,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
#if DBTYPE_SQLSERVER #if DBTYPE_SQLSERVER
return (await update.ExecuteUpdatedAsync().ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryJobRsp>(); return (await update.ExecuteUpdatedAsync().ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryJobRsp>();
#else #else
return await update.ExecuteAffrowsAsync().ConfigureAwait(false) <= 0 return await update.ExecuteEffectsAsync().ConfigureAwait(false) <= 0
? null ? null
: await GetAsync(new QueryJobReq { Id = req.Id }).ConfigureAwait(false); : await GetAsync(new QueryJobReq { Id = req.Id }).ConfigureAwait(false);
#endif #endif

View File

@ -57,7 +57,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await Rpo.DeleteAsync(a => a.Id == req.Id).ConfigureAwait(false); var ret = await Rpo.DeleteAsync(a => a.Id == req.Id).ConfigureAwait(false);
_ = await Rpo.Orm.Delete<Sys_RoleMenu>().Where(a => a.MenuId == req.Id).ExecuteAffrowsAsync().ConfigureAwait(false); _ = await Rpo.Orm.Delete<Sys_RoleMenu>().Where(a => a.MenuId == req.Id).ExecuteEffectsAsync().ConfigureAwait(false);
return ret; return ret;
} }

View File

@ -129,7 +129,7 @@ public sealed class UserService(
var ret = await Rpo.DeleteAsync(req.Id).ConfigureAwait(false); var ret = await Rpo.DeleteAsync(req.Id).ConfigureAwait(false);
// 删除分表 // 删除分表
_ = await Rpo.Orm.Delete<Sys_UserRole>(new { UserId = req.Id }).ExecuteAffrowsAsync().ConfigureAwait(false); _ = await Rpo.Orm.Delete<Sys_UserRole>(new { UserId = req.Id }).ExecuteEffectsAsync().ConfigureAwait(false);
// 删除档案表 // 删除档案表
_ = await userProfileService.DeleteAsync(req).ConfigureAwait(false); _ = await userProfileService.DeleteAsync(req).ConfigureAwait(false);

View File

@ -9,7 +9,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2"> <PackageReference Include="coverlet.collector" Version="6.0.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@ -14,7 +14,7 @@
"aieditor": "1.3.3", "aieditor": "1.3.3",
"axios": "1.7.9", "axios": "1.7.9",
"crypto-js": "4.2.0", "crypto-js": "4.2.0",
"echarts": "5.5.1", "echarts": "5.6.0",
"element-plus": "2.9.1", "element-plus": "2.9.1",
"json-bigint": "1.0.0", "json-bigint": "1.0.0",
"markdown-it": "14.1.0", "markdown-it": "14.1.0",