From bc8e0ea8ad37759ea3e3e2ebb60bdef75b49a911 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Tue, 6 Oct 2020 21:33:44 +0800 Subject: [PATCH] Update Application-Services.md --- docs/en/Best-Practices/Application-Services.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/en/Best-Practices/Application-Services.md b/docs/en/Best-Practices/Application-Services.md index 3332ce08ea..b14770d654 100644 --- a/docs/en/Best-Practices/Application-Services.md +++ b/docs/en/Best-Practices/Application-Services.md @@ -213,6 +213,12 @@ This method votes a question and returns the current score of the question. * **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. +#### Handle files + +* **Do not** use any file-related components(like `IFormFile`) or `Stream` in the application service interface. You can use primitive types as file parameters. Such as `byte[]`. +* **Do** use a controller to handle file upload and call a application service method. + + #### Using Other Application Services * **Do not** use other application services of the same module/application. Instead;