electronic heartbreak.
How is Modelstate.IsValid triggered?
When Mr. chatgpt generates an example I see it do the following:
1. The DTO has basic validation
2. The entity constructor has complex validation
3. An exception gets thrown when the complex validation fails.
91 replies
How is Modelstate.IsValid triggered?
Cant i do the following?
1. Add basic validation like required,min/max length to the DTO
2. map the DTO to the entity
3. Perform more advanced validation to the Entity
4. By errors, return an error and if correct perform a save to the database
91 replies