private void RefreshGeofences(IList <TriggeredAlarm> triggeredAlarms) { var geofences = triggeredAlarms .Where(alarm => !string.IsNullOrEmpty(alarm.Alarm.ActiveDays)) .Select(alarm => alarm.Report.Geofence); foreach (var geofence in geofences) { _geofenceService.ReplaceGeofence(geofence.Id, geofence); } }
public async Task UpdateAsync(Alarm alarm) { if (!GeolocationAlarms.Contains(alarm)) { return; } ReplaceAlarm(alarm); await _repository.UpdateAsync(alarm).ConfigureAwait(false); _geofenceService.ReplaceGeofence(alarm.Name, _builder.BuildFromAlarm(alarm)); }