Timeline for Why is it so common to use the dbContext directly in the controller in a WebApi application?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 4, 2024 at 7:12 | comment | added | inaba |
One is that what happen if I want to use a new version of entity core. Sometimes there are some breaking updates that modify the behavior of entity core Interfaces are always nice to use, especially for mail, document generation, and all such things. Makes it easier to test. But I mean, what you're describing is just moving the problem of updating from one place to another
|
|
| Sep 3, 2024 at 15:46 | vote | accept | Álvaro García | ||
| Sep 2, 2024 at 16:18 | answer | added | Ewan | timeline score: 3 | |
| Sep 2, 2024 at 13:26 | review | Close votes | |||
| Sep 17, 2024 at 3:09 | |||||
| Sep 2, 2024 at 12:26 | comment | added | Bart van Ingen Schenau | @user1937198: That looks like an answer. Can you copy it over to the answer box? | |
| Sep 2, 2024 at 11:03 | comment | added | user1937198 | 1) In online documentation, everything is oversimplified because of space constraints. 2) Because what matters overall is not how does the controller need to change, but how much needs to be changed in the application overall. If your controller methods are simple data access, and don't have much in the form of an underlying data model, then it is likely that any change to the EF core interface would require as much work changing a repository vs controllers. You don't reduce the work, only move it, unless you can come up with an abstraction shared by multiple endpoints. | |
| Sep 2, 2024 at 10:55 | history | asked | Álvaro García | CC BY-SA 4.0 |