Fix local seen

rendering v3.5
Liza 2023-02-26 17:54:15 +01:00
parent 8279bfe9bf
commit 7179d41e59
1 changed files with 2 additions and 1 deletions

View File

@ -26,8 +26,9 @@ namespace Pal.Client.Floors.Tasks
{
logger.LogInformation("Marking {Count} locations as seen locally in territory {Territory}", _locations.Count,
_territory.TerritoryType);
List<int> localIds = _locations.Select(l => l.LocalId).Where(x => x != null).Cast<int>().ToList();
dbContext.Locations
.Where(loc => _locations.Any(l => l.LocalId == loc.LocalId))
.Where(loc => localIds.Contains(loc.LocalId))
.ExecuteUpdate(loc => loc.SetProperty(l => l.Seen, true));
dbContext.SaveChanges();
}