Hi Jonny,
Updated rules to consider InputProperties as Dependency for PropertyRules
Updated BusinessRules.RuleSet property to clear broken rules collection when set.
Updated business rule - PrimaryProperty to virtual
Added base classes for rules:
PropertyRule - for property rule to run with no restrictions
PropertyEditRule - only when property is changed or CheckRules on client
LookupRule - async lookup rule only when a property is changed
ObjectRule - for object rule - will always return null on PrimaryProperty and throw exception when PrimaryProperty is set to a non null value.
CommonRules.CommonBusinessRule - inherits from PropertyRule (and moved Severity property to PropertyRule).
The new base classes will need some more documentation on how/when to use, etc.
Hi Tiago,
We've had som discussions on the base classes and have decided to just go with
You can create your own subclasses as you like in your own code.
I'm also working a new sample - RuleTutorial - to give more detailed info on how to write rules and use the base classes.
Hi Jonny,
I was exactly adding BusinessRule support to CslaGenFork - read them from a DLL/EXE and fill out the form for the user type the intended values. Than you changed some of it and I reflected the changes CGF side right away. Now it changed again. Maybe I'll wait until it gets stable.
Hi Jonny,
Concerning PropertyRule documentation, there are two things that need to be corrected:
Regards
Thx Tiago,
Updated and committed to repository.
I'm also working a new sample - RuleTutorial - to give more detailed info on how to write rules and use the base classes.
Hi Jonny,
The sample has some building problems since it's using Csla 4.1 DLL that are in the Dependencies folder.
Another note to say I was'nt aware of the following
[quote]
Csla DataPortal will enforce authorization rules for "root" objects. Please be aware that the Child DataPortal methods down NOT enforce authorization rules so to check for authorization on child merthods you MUST add this into your own code.
Hi Jonny,
In the Range.cs rule
where it reads
public Range(IPropertyInfo primaryProperty, IComparable min, IComparable max, string message) : this(primaryProperty, min, max) { message = message; }
it should read
public Range(IPropertyInfo primaryProperty, IComparable min, IComparable max, string message) : this(primaryProperty, min, max) { MessageText = message; }
Regards
Hi Tiago,
Thx again, Range rule and more is updated. The Samples\Dependencies folder is only updated when a release is made as these are binary files and we do not want to check in new version whenever a change is made in Csla.
removed
Copyright (c) Marimer LLC