To cases where we have a rich domain model when using DDD, is important to separate Contract validation to Command validation, being the first one a syntax validation (Like nullables, string ranges, number ranges, etc.) and the second one a semantic validation (a item exist in the repository, a specific service is available, etc).
To do that, we can add AspNetCore Middlewares to do syntax validation, and IPipelineBehaviors to semantic validation inside a given use case, implies a new VSlices.CrossCutting.AspNetCore.DataAnnotationMiddleware.
To cases where we have a rich domain model when using DDD, is important to separate Contract validation to Command validation, being the first one a syntax validation (Like nullables, string ranges, number ranges, etc.) and the second one a semantic validation (a item exist in the repository, a specific service is available, etc).
To do that, we can add AspNetCore Middlewares to do syntax validation, and IPipelineBehaviors to semantic validation inside a given use case, implies a new VSlices.CrossCutting.AspNetCore.DataAnnotationMiddleware.