0
greatsamps created
Hi,
In our application, we are checking some bits that require a database lookup (duplicates etc) during the method call to the Add/Update method on the AppServices. What i am looking to do is throw a detailed validation exception if something is incorrect.
I have found this link:
<a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Validating-Data-Transfer-Objects">https://aspnetboilerplate.com/Pages/Doc ... er-Objects</a>
but it is not clear how i can get hold of the validation context from an appservice.
Please advise.
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
0
If you want to make some DB requests in your DTO it's a very bad practice. You should do it in your Application Service method.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
You can throw AbpValidationException.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)