To cast your pearls before swine

to waste your time by offering something that is helpful or valuable to someone who does not appreciate or understand it.

e.g. I spent hours making a very sophisticated restaurant-quality meal. My daughter said she preferred frozen pizza. Clearly, I was casting my pearls before swine!

“Swine” are pigs.
The idiom is first used in the Bible where Jesus’ followers are warned only to preach to a responsive audience.