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.

MSc. | Tech writer with +1M views. Sharing my opinion and what I learn. .NET backend engineer, ex big4 SC. New YouTube Channel https://bit.ly/3vxqNHj

MSc. | Tech writer with +1M views. Sharing my opinion and what I learn. .NET backend engineer, ex big4 SC. New YouTube Channel https://bit.ly/3vxqNHj