private void _mapEntitiesHub_OnAreaReceived(AreaDto areaDto) { MyShape myShape = new() { Id = areaDto.Id, Name = areaDto.Name, IsClosed = areaDto.IsClosed }; MyShape firstShape = MyShapes.FirstOrDefault(s => s.Id == myShape.Id); if (firstShape is null) { MyShapes.Add(myShape); } else { firstShape.IsClosed = myShape.IsClosed; } }
private void _mapEntitiesHub_OnAreaDeleted(AreaDto areaDto) { MyShape shape = MyShapes.FirstOrDefault(s => s.Id == areaDto.Id); MyShapes.Remove(shape); }