Tracks the business rules for a business object.
More...
|
static void | AddRule (Type objectType, IAuthorizationRule rule) |
| Associates a per-type authorization rule with the business type in the default rule set. More...
|
|
static void | AddRule (Type objectType, IAuthorizationRule rule, string ruleSet) |
| Associates a per-type authorization rule with the business type. More...
|
|
static bool | HasPermission (AuthorizationActions action, Type objectType) |
| Checks per-type authorization rules. More...
|
|
static bool | HasPermission (AuthorizationActions action, Type objectType, object[] criteria) |
| Checks per-type authorization rules. More...
|
|
static bool | HasPermission (AuthorizationActions action, Type objectType, string ruleSet) |
| Checks per-type authorization rules. More...
|
|
static bool | HasPermission (AuthorizationActions action, object obj) |
| Checks per-instance authorization rules. More...
|
|
static bool | HasPermission (AuthorizationActions action, object obj, string ruleSet) |
| Checks per-instance authorization rules. More...
|
|
static BrokenRulesTree | GetAllBrokenRules (object root) |
| Gets all nodes in tree that have IsValid = false (and all parents) More...
|
|
static BrokenRulesTree | GetAllBrokenRules (object root, bool errorsOnly) |
| Gets all nodes in tree that have broken rules. More...
|
|
|
bool | SuppressRuleChecking [getset] |
| Gets or sets a value indicating whether calling CheckRules should result in rule methods being invoked. More...
|
|
int | ProcessThroughPriority [getset] |
| Gets or sets the priority through which all rules will be processed. More...
|
|
string?? | RuleSet [getset] |
| Gets or sets the rule set to use for this business object instance. More...
|
|
bool | CascadeOnDirtyProperties [getset] |
| Gets or sets a value indicating whether rule engine should cacade n-leves when property value is changed from OuputPropertyValues. More...
|
|
bool | IsValid [get] |
| Gets a value indicating whether there are any currently broken rules, which would mean the object is not valid. More...
|
|
bool | RunningRules [get] |
| Gets a value indicating whether a CheckRules operation is in progress. More...
|
|
bool | RunningAsyncRules [getset] |
| Gets a value indicating whether any async rules are currently executing. More...
|
|
object | Target [get] |
| Gets the target business object More...
|
|
Tracks the business rules for a business object.
Definition at line 27 of file BusinessRules.cs.
◆ BusinessRules()
Csla.Rules.BusinessRules.BusinessRules |
( |
| ) |
|
◆ AddDataAnnotations()
void Csla.Rules.BusinessRules.AddDataAnnotations |
( |
| ) |
|
Adds validation rules corresponding to property data annotation attributes.
Definition at line 900 of file BusinessRules.cs.
◆ AddRule() [1/5]
Associates an authorization rule with the business object.
- Parameters
-
Definition at line 192 of file BusinessRules.cs.
◆ AddRule() [2/5]
Associates a business rule with the business object.
- Parameters
-
Definition at line 172 of file BusinessRules.cs.
◆ AddRule() [3/5]
Associates a business rule with the business object.
- Parameters
-
rule | Rule object. |
ruleSet | Rule set name. |
Definition at line 182 of file BusinessRules.cs.
◆ AddRule() [4/5]
Associates a per-type authorization rule with the business type in the default rule set.
- Parameters
-
objectType | Type of business object. |
rule | Rule object. |
Definition at line 204 of file BusinessRules.cs.
◆ AddRule() [5/5]
static void Csla.Rules.BusinessRules.AddRule |
( |
Type |
objectType, |
|
|
IAuthorizationRule |
rule, |
|
|
string |
ruleSet |
|
) |
| |
|
static |
Associates a per-type authorization rule with the business type.
- Parameters
-
objectType | Type of business object. |
rule | Rule object. |
ruleSet | Rule set name. |
Definition at line 216 of file BusinessRules.cs.
◆ CachePermissionResult()
Gets a value indicating whether the permission result can be cached.
- Parameters
-
action | Authorization action. |
element | Property or method to check. |
Definition at line 423 of file BusinessRules.cs.
◆ CheckObjectRules()
List< string > Csla.Rules.BusinessRules.CheckObjectRules |
( |
| ) |
|
Invokes all rules attached at the class level of the business type.
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property.
Definition at line 507 of file BusinessRules.cs.
◆ CheckRules() [1/2]
List< string > Csla.Rules.BusinessRules.CheckRules |
( |
| ) |
|
Invokes all rules for the business type.
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property.
Definition at line 480 of file BusinessRules.cs.
◆ CheckRules() [2/2]
Invokes all rules for a specific property of the business type.
- Parameters
-
property | Property to check. |
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property.
- Exceptions
-
System.ArgumentNullException | If property is null |
Definition at line 575 of file BusinessRules.cs.
◆ CheckRulesAsync() [1/2]
async Task< List< string > > Csla.Rules.BusinessRules.CheckRulesAsync |
( |
| ) |
|
Invokes all rules for the business type.
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property. Does not return until all async rules are complete.
Definition at line 467 of file BusinessRules.cs.
◆ CheckRulesAsync() [2/2]
async Task< List< string > > Csla.Rules.BusinessRules.CheckRulesAsync |
( |
int |
timeout | ) |
|
Invokes all rules for the business type.
- Parameters
-
timeout | Timeout value in milliseconds |
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property. Does not return until all async rules are complete.
Definition at line 446 of file BusinessRules.cs.
◆ GetAllBrokenRules() [1/2]
static BrokenRulesTree Csla.Rules.BusinessRules.GetAllBrokenRules |
( |
object |
root | ) |
|
|
static |
Gets all nodes in tree that have IsValid = false (and all parents)
- Parameters
-
- Returns
- BrukenRulesTree list
Definition at line 1049 of file BusinessRules.cs.
◆ GetAllBrokenRules() [2/2]
static BrokenRulesTree Csla.Rules.BusinessRules.GetAllBrokenRules |
( |
object |
root, |
|
|
bool |
errorsOnly |
|
) |
| |
|
static |
Gets all nodes in tree that have broken rules.
- Parameters
-
root | The root. |
errorsOnly | if set to true will only return objects that gave IsValid = false. |
- Returns
Definition at line 1059 of file BusinessRules.cs.
◆ GetBrokenRules()
◆ GetPropertyBusy()
Gets a value indicating whether a specific property has any async rules running.
- Parameters
-
property | Property to check. |
Definition at line 301 of file BusinessRules.cs.
◆ GetRuleDescriptions()
string[] Csla.Rules.BusinessRules.GetRuleDescriptions |
( |
| ) |
|
Gets a list of rule:// URI values for the rules defined in the object.
- Returns
Definition at line 131 of file BusinessRules.cs.
◆ HasPermission() [1/6]
Checks per-property authorization rules.
- Parameters
-
action | Authorization action. |
element | Property or method to check. |
Definition at line 394 of file BusinessRules.cs.
◆ HasPermission() [2/6]
Checks per-instance authorization rules.
- Parameters
-
action | Authorization action. |
obj | Business object instance. |
Definition at line 350 of file BusinessRules.cs.
◆ HasPermission() [3/6]
static bool Csla.Rules.BusinessRules.HasPermission |
( |
AuthorizationActions |
action, |
|
|
object |
obj, |
|
|
string |
ruleSet |
|
) |
| |
|
static |
Checks per-instance authorization rules.
- Parameters
-
action | Authorization action. |
obj | Business object instance. |
ruleSet | The rule set. |
- Returns
true
if the specified action has permission; otherwise, false
.
Definition at line 364 of file BusinessRules.cs.
◆ HasPermission() [4/6]
Checks per-type authorization rules.
- Parameters
-
action | Authorization action. |
objectType | Type of business object. |
Definition at line 311 of file BusinessRules.cs.
◆ HasPermission() [5/6]
static bool Csla.Rules.BusinessRules.HasPermission |
( |
AuthorizationActions |
action, |
|
|
Type |
objectType, |
|
|
object[] |
criteria |
|
) |
| |
|
static |
Checks per-type authorization rules.
- Parameters
-
action | Authorization action. |
objectType | Type of business object. |
criteria | The criteria object provided. |
Definition at line 324 of file BusinessRules.cs.
◆ HasPermission() [6/6]
static bool Csla.Rules.BusinessRules.HasPermission |
( |
AuthorizationActions |
action, |
|
|
Type |
objectType, |
|
|
string |
ruleSet |
|
) |
| |
|
static |
Checks per-type authorization rules.
- Parameters
-
action | Authorization action. |
objectType | Type of business object. |
ruleSet | The rule set. |
- Returns
true
if the specified action has permission; otherwise, false
.
Definition at line 340 of file BusinessRules.cs.
◆ OnGetChildren()
Override this method to insert your child object references into the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
formatter | Reference to MobileFormatter instance. Use this to convert child references to/from reference id values. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 993 of file BusinessRules.cs.
◆ OnGetState()
Override this method to insert your field values into the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
mode | The StateMode indicating why this method was invoked. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 956 of file BusinessRules.cs.
◆ OnSetChildren()
Override this method to retrieve your child object references from the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
formatter | Reference to MobileFormatter instance. Use this to convert child references to/from reference id values. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 1015 of file BusinessRules.cs.
◆ OnSetState()
Override this method to retrieve your field values from the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
mode | The StateMode indicating why this method was invoked. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 974 of file BusinessRules.cs.
◆ CascadeOnDirtyProperties
bool Csla.Rules.BusinessRules.CascadeOnDirtyProperties |
|
getset |
Gets or sets a value indicating whether rule engine should cacade n-leves when property value is changed from OuputPropertyValues.
true
if [cascade when changed]; otherwise, false
.
Definition at line 95 of file BusinessRules.cs.
◆ IsValid
bool Csla.Rules.BusinessRules.IsValid |
|
get |
Gets a value indicating whether there are any currently broken rules, which would mean the object is not valid.
Definition at line 239 of file BusinessRules.cs.
◆ ProcessThroughPriority
int Csla.Rules.BusinessRules.ProcessThroughPriority |
|
getset |
Gets or sets the priority through which all rules will be processed.
Definition at line 63 of file BusinessRules.cs.
◆ RuleSet
string?? Csla.Rules.BusinessRules.RuleSet |
|
getset |
Gets or sets the rule set to use for this business object instance.
Definition at line 74 of file BusinessRules.cs.
◆ RunningAsyncRules
bool Csla.Rules.BusinessRules.RunningAsyncRules |
|
getset |
Gets a value indicating whether any async rules are currently executing.
Definition at line 283 of file BusinessRules.cs.
◆ RunningRules
bool Csla.Rules.BusinessRules.RunningRules |
|
get |
Gets a value indicating whether a CheckRules operation is in progress.
Definition at line 258 of file BusinessRules.cs.
◆ SuppressRuleChecking
bool Csla.Rules.BusinessRules.SuppressRuleChecking |
|
getset |
Gets or sets a value indicating whether calling CheckRules should result in rule methods being invoked.
True to suppress all rule method invocation.
Definition at line 52 of file BusinessRules.cs.