Closed Brend-Smits closed 3 years ago
In GitLab by @Brend-Smits on Mar 28, 2020, 20:51
mentioned in merge request !12
In GitLab by @Brend-Smits on Mar 29, 2020, 20:17
changed the description
In GitLab by @RensvdLinden on Mar 30, 2020, 11:27
assigned to @RensvdLinden
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