Fix local seen
This commit is contained in:
parent
8279bfe9bf
commit
7179d41e59
@ -26,8 +26,9 @@ namespace Pal.Client.Floors.Tasks
|
|||||||
{
|
{
|
||||||
logger.LogInformation("Marking {Count} locations as seen locally in territory {Territory}", _locations.Count,
|
logger.LogInformation("Marking {Count} locations as seen locally in territory {Territory}", _locations.Count,
|
||||||
_territory.TerritoryType);
|
_territory.TerritoryType);
|
||||||
|
List<int> localIds = _locations.Select(l => l.LocalId).Where(x => x != null).Cast<int>().ToList();
|
||||||
dbContext.Locations
|
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));
|
.ExecuteUpdate(loc => loc.SetProperty(l => l.Seen, true));
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user