paul.samways.id.au

Recent activity

TIL: Query JSON collections with EF Core

Note—

EF Core can map a collection of simple values, such as a List<string> of tags, using PrimitiveCollection:

builder.PrimitiveCollection(x => x.Tags)
  .HasColumnName("tags")
  .IsRequired();

This gives EF Core the collection element metadata needed to query individual values. For example, find content tagged dotnet with:

var results = await db.Content
  .Where(x => x.Tags.Contains("dotnet"))
  .ToListAsync();

With SQLite, the collection is stored as a JSON array, and EF Core translates Contains using json_each. This keeps the filtering in the database without writing SQL by hand.

Let me ch...

Bookmark—

An enjoyable piece of fiction.

Was it LLM generated? Who knows, but it sure was a nice read.

Samsung Soundbar S60a - Disabling Bluetooth

Post—

We recently ran into a frustrating issue with our bedroom audio setup: our neighbour keeps pairing with our soundbar and blasting their music at full volume. What makes it worse is that the speaker is mounted right above our heads when we're in bed, and this uninvited wake-up call has happened several nights around 9 pm.

After leaving it unplugged for a week out of pure annoyance, I decided to investigate whether the Bluetooth could be disabled permanently, especially since we only use a wired connection anyway. Unfortunately, after digging through all the settings and online forums, it turns out Samsung didn’t include a software option to turn off the wireless radio.

With a software fix ruled out, I decided to open up the casing to see if I could locate the Bluetooth module and physically disconnect it. This turned out to be much easier than expected; both the Wi-Fi and Bluetooth connectivity were handled by modules attached to the main board via a simple ribbon cable.

Open Samsung S60 Soundbar

I unplugged the cable, put everything back together, and crossed my fingers. Thankfully, the soundbar's firmware is perfectly happy to operate without those modules plugged in. Problem solved. We finally have our quiet nights back.