I have an AppService that has an update method. I am receiving DateFrom and DateTo and I need to check if entered dates already exist in the database. Usually in aspnet boilerplate where do I perform that check? I want to keep AppServices simple without any database validation logic.
Thanks in advance
1 Answer(s)
-
0
Hi @antonis
If this is a single use case, you can create a private method in your app service and use it in your AppService method. If this is a commonly used method, you can create a custom repository method (see https://aspnetboilerplate.com/Pages/Documents/Repositories#custom-repositories) or you can create a domain service (see https://aspnetboilerplate.com/Pages/Documents/Domain-Services) if this is something related to your domain logic and create a method in that domain service. In the domain service, you can directly use generic repositories.