Merge branch 'develop' into hotfix/FixDeviceUpsert

This commit is contained in:
Samuele Locatelli
2023-01-11 14:15:39 +01:00
+8 -4
View File
@@ -208,7 +208,7 @@ namespace GPW.CORE.Data.Controllers
{
try
{
if (currItem.IdxRa == 0)
if (currItem.IdxDevice == 0)
{
localDbCtx.Entry(currItem).State = EntityState.Added;
}
@@ -225,12 +225,16 @@ namespace GPW.CORE.Data.Controllers
oldRec.DataOraLastSeen = DateTime.Now;
oldRec.Description = currItem.Description;
oldRec.ScreenSize = currItem.ScreenSize;
localDbCtx
.DbSetAnagDevices
.Update(oldRec);
}
// altrimenti aggiungo
else
{
localDbCtx
.DbSetAnagDevices
.Add(currItem);
.DbSetAnagDevices
.Update(currItem);
}
}
// ora salvo!
@@ -239,7 +243,7 @@ namespace GPW.CORE.Data.Controllers
}
catch (Exception exc)
{
Log.Error($"Errore in AnagDeviceInsert:{Environment.NewLine}{exc}");
Log.Error($"Errore in AnagDeviceUpdate:{Environment.NewLine}{exc}");
}
}
return done;