Field validation at the Entity level - I see this using
attributes to identify acceptable inputs. The NAnt
project does this quite well checking for required
attributes on tasks. I think we could hook something
like this inside of the AbstractEntity.Persist method.
The method would just call a Validate method that
would inspect the entity, extract the attribute
information and then throw a ValidationException if it
does not match the specified criteria. I still have
not figured out how to handle how to display the error
results back to the client in a non-confusing way
(maybe hold an internal collection of
ValidationErrors on the Enity object?).
I have sent a note to Morten of Gentle .Net to see if
he thinks something like this would be useful inside of
Log in to post a comment.