Hi everyone,
I am new to CSLA and still learning the basics. With validation in CSLA.NET we write something like this in property procedures for a Business Object
BrokenRules.Assert("Name","Name Required", Len(value)=0)
This works great. However, how can we do validate one property against the other. For instance if I want to check Gender with DateOfBirth i.e. If both are missing then the Business Object should be invalid. How and where can we do such validations?
Help much appreciated
Tahir
Here is a long discussion on this very subject:
http://forums.lhotka.net/forums/thread/8470.aspx
Hi,
It was helpful thanks. However, it does not discuss (may be directly) the issue I have.
May be you can clarify. I have two properties in BO. Before saving them I need to validate one against the other. Within the property procedure of each, I can't put that. Why? Because unless user presses 'Save' button that rule should not be invoked.
Tahir
I am assuming that you are doing something along the lines of a StartDate/EndDate scenario where the EndDate value has to be greater than the StartDate in order to be valid. You can find an example of how to do this in the ProjectTracker sample app (check the latest version).
HTH
Copyright (c) Marimer LLC