Merge branch 'hotfix/FixDeviceUpsert'
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user