More complex Validation options #26
Replies: 2 comments 4 replies
-
Hey @matt-tolliday-iss we do support validation data annotiations on the POCO model so you could in theory create a custom data annotation to validate the uniquness and Konstrukt should then fail it's model validation. I'm sure there could be something we could do though to add support for custom validators as part of the fluent configuration. This said, it sounds like there is a bug here too as the UI shouldn't give a success message if there is a SQL error when asked to save. |
Beta Was this translation helpful? Give feedback.
-
@mattbrailsford one more! sorry! - it looks like its not honouring the "false" return value of the IsValid overload with ValidationContext - I can see that despite the latter return value in the screenshot below, its still attempting to do the insert/create in the Umbraco logs, which fails due to the database constraint. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Would it possible to consider enabling more complex validation options other than a Regex on a field, as is currently available.
My specific scenario is to ensure a uniqueness of the entity being saved on two particular fields within the database table.
When trying to create a new entity which violates the constraint, Konstukt returns a green successful message to the UI, but throws an exception, and the entity is not added/created (which is expected)
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Beta Was this translation helpful? Give feedback.
All reactions