private async Task UpdateList(RecordChangedEventArgs <Station> e) { await Task.Delay(1); if (e.ChangeType == ChangeType.None) { return; } if (e.ChangeType == ChangeType.Delete) { var s = Stations.FirstOrDefault(c => c.Model.StationId == e.Entity.StationId); if (s == null) { return; } Stations.Remove(s); } if (e.ChangeType == ChangeType.Insert) { if (Stations.Contains(new StationModel(e.Entity, _repository))) { return; } Stations.Add(new StationModel(e.Entity, _repository)); } if (e.ChangeType == ChangeType.Update) { var s = Stations.FirstOrDefault(c => c.Model.StationId == e.Entity.StationId); if (s == null) { return; } var i = Stations.IndexOf(s); Stations.Remove(s); Stations.Insert(i, new StationModel(e.Entity, _repository)); } }