Painting MDF cabinets used to be my bread and butter.
I primed them with Leyland Trade acrylic primer/undercoat. I then thoroughly sanded them with 180grit (using a DA sander). I sanded about 75% of the paint away until I removed the factory produced scores in the finish. I then followed up with two coats of Dulux Trade oil based eggshell.
You could go for waterbased finishes but they are far less durable. They do however cure faster and smell less.
Paint before assembly works well when spraying units with 2k paints, largely because you don't get a big build up of paint on the edges of the shelves/etc. Hand painting can lead to massive build up at the edges.
A general purpose water-based undercoat, with quick drying and low odour properties. Suitable for interior and exterior bare timber surfaces. Coverage approx 13m² per litre. • Low odour water-based undercoat • Quick drying with a recoat time of just 1-2 hours • Impressive coverage of 13...
I have never used the dedicated water based Leyland MDF primer. I cannot comment on it, but the one that I recommended is a dream to sand flat. In my (extensive experience) most water based primers are a pain to sand back- they clog the abrasives. Once the paper is clogged you cannot sand the mdf flat.
All of the units that I hand painted were insitu, but because of the smell, the customers would move out of the room for a week. I was often painting 4 (double bay) wardrobes though.