DigitalExcellence / dex-backend

Backend for Digital Excellence Platform
https://dex.software
GNU Lesser General Public License v3.0
21 stars 10 forks source link

Investigate saving the database with EF Core #53

Closed Brend-Smits closed 3 years ago

Brend-Smits commented 4 years ago

In GitLab by @StijnGroenen on Mar 28, 2020, 20:47

Currently the database is saved by calling .Save onto a services. This service is calling the repository and the repository calls DbContext.SaveChangesAsync(). Doing it this way, only the object add/updated/removed by that services is saved instead of all objects.

If you would call DbContext.SaveChangesAsync() in the controller you would save all the objects and make good use of the EF Core queue BUT you are accessing the data layer which shouldn't be accessed in the API level.

Related Epic: https://git.fhict.nl/dex/dex-epics/-/issues/14

Brend-Smits commented 4 years ago

In GitLab by @Brend-Smits on Mar 28, 2020, 20:51

mentioned in merge request !12

Brend-Smits commented 4 years ago

In GitLab by @Brend-Smits on Mar 29, 2020, 20:17

changed the description

Brend-Smits commented 4 years ago

In GitLab by @RensvdLinden on Mar 30, 2020, 11:27

assigned to @RensvdLinden