fix:修复规则主体重复校验逻辑错误-2

This commit is contained in:
hardstylewyl 2025-03-07 12:00:16 +08:00
parent ef055943f6
commit f12a741100

View File

@ -14,13 +14,11 @@ public sealed class WarningRuleRepository : BasicRepository<WarningRuleEntity>,
public async Task<bool> CheckNameDuplicateAsync(int id, int subsystemId, int customId, string name)
{
var list = await Context.Queryable<WarningRuleEntity>()
var entity = await Context.Queryable<WarningRuleEntity>()
.Where(x => x.SubSystemId == subsystemId &&
x.CustomId == customId
&& string.Equals(x.Name, name))
.ToListAsync();
var entity = list.First();
.FirstAsync();
// 不重复
if (entity == null)