Hi Björn,

Thanks for reading my article. It’s much appreciated :)

True, it’s not the responsibility of the repository to do all that work.

But, it’s beside the point of this article. I didn’t want to go thru every architectural layer just to show how if-else can be replaced by polymorphic execution.

Ideally, you’d want to have a command object and command handler, where the command handler takes the repository as a dependency.

Written by

Tech writer with 621K+ views. Sharing my opinion and what I learn. Danish C# backend engineer in FinTech. Ex Big4 senior tech consultant.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store