This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi guys - am playing round with LightSpeed at the moment, in the process of evaluating it for use in Intergen Auckland. I was working through a contrived example I made up and was just writing tests against it from the point of view of everyday things that people would do if they were using it. So I made a uniqueness test: [Test, ExpectedException(typeof(ValidationException))] According to the docs when I try and flush some objects they should be validated and I should get an exception if any of the them are invalid. "Objects are always validated before they are saved to the database and a ValidationException will be raised if an attempt is made to save an invalid object." My implementation is:
|
|
|
Hi Joe, This validation is designed to check the uniqueness of the field in relation to all existing entities in the database (underneath the covers it runs a simple count query.) The canonical example of this is for things like emails, usernames etc. We are happy to add further validators based on feedback so feel free to bug us :-) Cheers, Andrew. P.S. You moving to Wellington any time soon? ;-)
|
|