226
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns
Using field validation with data annotations, for example, you do not
duplicate the validation
definition. The execution, though, can be both server-side and client-side in the case of DTOs
(commands and ViewModels, for instance).
Additional resources
•
Rachel Appel. Introduction to model validation in ASP.NET Core MVC
https://learn.microsoft.com/aspnet/core/mvc/models/validation
•
Rick Anderson. Adding validation
https://learn.microsoft.com/aspnet/core/tutorials/first-mvc-app/validation
•
Martin Fowler. Replacing Throwing Exceptions with Notification in Validations
https://martinfowler.com/articles/replaceThrowWithNotification.html
•
Dostları ilə paylaş: