Skip to content

Instantly share code, notes, and snippets.

View Jaans's full-sized avatar

Jaans Jaans

  • Brisbane, Australia
View GitHub Profile
@Jaans
Jaans / Example.cs
Last active August 29, 2015 14:02
CSLA (>= v4.0) QuickRule Source
// Example 1. This sample creates and adds a lambda rule (LogChangeRule)
// for the primary property PostCode
BusinessRules.AddRule( new QuickRule( LogChangeRule ).For( PostCodeProperty ) );
// Example 2. This sample creates and adds a lambda rule (CheckIfExistsRule)
// for the primary property PostCode, and uses it as an input property
BusinessRules.AddRule( new QuickRule( CheckIfExistsRule ).For( PostCodeProperty ).UsingIt() );
// Example 3. This sample creates and adds a lambda rule (MutatePostCodeToUpperCase)
// for the primary property PostCode (using the PostCode as an "input property")