-
Notifications
You must be signed in to change notification settings - Fork 13
Validations in C# Codes
fonlow edited this page Feb 28, 2024
·
3 revisions
Validations in C# for POCO classes are generally done through declarative attributes decorating each property. OpenApiClientGen can generate client API C# codes with respective attributes according to data constraints in OpenAPI definitions.
Constraints | Attributes |
---|---|
required | Required |
minLength | MinLength |
maxLength | MaxLength |
minimum | Range |
maximum | Range |
pattern | RegularExpression |
date | DateType(DataAnnotations.DataType.Date) if DateToDateOnly is false |