From 3aa114b1d6966cde488d97afd327015a04795844 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Sun, 14 Apr 2019 12:49:36 +0300 Subject: [PATCH] Update Application-Services.md --- docs/en/Best-Practices/Application-Services.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/Best-Practices/Application-Services.md b/docs/en/Best-Practices/Application-Services.md index 7624464e17..0979304931 100644 --- a/docs/en/Best-Practices/Application-Services.md +++ b/docs/en/Best-Practices/Application-Services.md @@ -203,12 +203,13 @@ This method votes a question and returns the current score of the question. #### Manipulating / Deleting Entities * **Do** always get all the related entities from repositories to perform the operations on them. +* **Do** call repository's Update/UpdateAsync method after updating an entity. Because, not all database APIs support change tracking & auto update. #### Using Other Application Services * **Do not** use other application services of the same module/application. Instead; * Use domain layer to perform the required task. - * Extract a new class and share between the application services to accomplish the code reuse when necessary. + * Extract a new class and share between the application services to accomplish the code reuse when necessary. But be careful to don't couple two use cases. They may seem similar at the beginning, but may evolve to different directions by time. So, use code sharing carefully. * **Can** use application services of others only if; * They are parts of another module / microservice. * The current module has only reference to the application contracts of the used module.