Does anyone have a simple example of implementing an async validation rule in csla?
I have looked at the example in the Company class in the Rolodex sample but this isn’t particularly clear to me: why do I need a command class?
I’m using csla 3.8 in a WPF application.
OK I figured out how to do this, but in the end it turned out that the answer opened a rather large can of worms.
Adding the Async rule to your business class:
The first arg for AddRule is a delegate shown below:
The delegate in turn calls a DuplicateUserNameCommand which is new type you need to create:
That’s about it. The problem that I encountered is that all the code in Command’s DataPortal_Execute needs to be thread safe. In my case this caused severak issues so for now I’m reverting back to synchronous rules.