Update x gestione metodi upsert

This commit is contained in:
Samuele Locatelli
2026-03-23 17:17:31 +01:00
parent 84144b4beb
commit 8c957edad8
31 changed files with 574 additions and 194 deletions
@@ -52,10 +52,10 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
dbCtx.DbSetJobStep.Remove(dbResult);
bool done = await dbCtx.SaveChangesAsync() > 0;
if (done)
tx.Commit();
return done;
}
catch
@@ -124,10 +124,10 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
dbCtx.Entry(currRec).State = EntityState.Modified;
bool done = await dbCtx.SaveChangesAsync() > 0;
if (done)
tx.Commit();
return done;
}
catch
@@ -140,7 +140,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
public async Task<bool> UpdateAsync(JobStepModel entity)
{
await using var dbCtx = await CreateContextAsync();
var trackedEntity = dbCtx.DbSetJobStep.Local.FirstOrDefault(x => x.JobStepID == entity.JobStepID);
var trackedEntity = await dbCtx.DbSetJobStep.FirstOrDefaultAsync(x => x.JobStepID == entity.JobStepID);
if (trackedEntity != null)
{