refator(SaveDocStatusCommandHandler): use SingleOrDefaultAsync instead of FirstOrDefaultAsync

This commit is contained in:
tekh 2025-08-25 15:56:37 +02:00
parent 82150290d2
commit cced0e5579

View File

@ -91,7 +91,7 @@ public class SaveDocStatusCommandHandler : IRequestHandler<SaveDocStatusCommand,
await _repo.CreateAsync(cReq, cancel);
}
var docStatus = await _repo.ReadOnly().Where(eExp).Where(rExp).FirstOrDefaultAsync(cancel);
var docStatus = await _repo.ReadOnly().Where(eExp).Where(rExp).SingleOrDefaultAsync(cancel);
return docStatus?.Id;
}
}