Anthony Trad
Apr 30, 2022

--

I had the same problem when switching from .NET Core 2.2 to 3.1. EF Core changed a lot to manipulate Views and Raw Queries. Your DB context is a class in the end that can be isolated just like a repository, so I achieved the same 'isolation' from our business layer.

Regarding testability, its a tradeoff like everything. This article is mainly targeting people who use this pattern for everything db related. If you have a complex project with a bug domain. Then sure you may find benefit in using that. Just don't abtract to abstract for the sake of clean code

--

--

Anthony Trad
Anthony Trad

Written by Anthony Trad

Senior Software Engineer focused on .NET and the Cloud. Reconsidering major principles and patterns, ideas are my own.

Responses (1)