A way to change color property of all entities in a custom data source without loop?

I cannot find a suitable approach to update the entire customdatasource colour property without looping on all entities after checking the entity type (if entity is box, polyline, ecc) before updating the material property.

Any faster approach to change/update a single color to all entities in a datasource?
thank you!