Value Object Conventions
Throughout the source code, we use value objects to represent concepts that are not entities, like DisplayName, Description, EntityId, etc. In this document we describe the conventions we follow when creating and using value objects. The library Tdp.Core contains the base classes and interfaces for value objects.
Text
A text value object is simply put, a string with some basic validations. The Tdp.Core library contains som utilities to implement validations for text value objects. Some value objects are based on the Text value object, like DisplayName, Description and EntityId.
Base type: string
Constraints:
- MinLength:
null - MaxLength:
null - Pattern:
null
First, you need to define the field validator in a class where all field validations are defined:
// TBDThen you can use the field validation in any request validator that has that field:
// TBDDisplayName
Base type: Text which is a string