Implement registry update

This commit is contained in:
2025-11-01 19:55:37 +09:00
parent 737e581f75
commit a9fd99bab8
4 changed files with 56 additions and 3 deletions

View File

@ -21,6 +21,17 @@ namespace Hcs.WebApp.Services
public async Task<Registry> GetRegistryByOperationIdAsync(int operationId)
{
using var context = GetNewContext();
return await GetRegistryByOperationIdAsync(context, operationId);
}
public async Task<Registry> GetRegistryByOperationIdAsync(HcsDbContext context, int operationId, bool includeElements = false)
{
if (includeElements)
{
return await context.Registries
.Include(x => x.Elements)
.SingleAsync(x => x.LastSyncOperationId == operationId);
}
return await context.Registries.SingleAsync(x => x.LastSyncOperationId == operationId);
}